Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2013

    Unanswered: How to update only current form

    Back again

    First I would like to thank everyone for all the help provided on dbforums without it would not be anyway near through the project.

    I have a form [Permit] which when on a clickon event feild [Postcode] loads another form. The new form [Postcodelookup] gathers information from a bit of code I found which performs a postcode lookup. The code works on the [postcodelookup] form and populates the first Form [Permit] address feilds but heres the problem it changes all the records address to the one selected in the [postcodelookup]

    How can I change only the record in focus ?

    I have tried a filter in the onload event [Permit] form to select only the current [ID] it does filter and show only the existing record but still all records have change when the filter has been removed

    Private Sub List2_Click()

    Forms!carpermit!Postcode = Me.Text0
    Forms!carpermit!AddressLine1 = Me.address1
    Forms!carpermit!AddressLine2 = Me.address2
    Forms!carpermit!AddressLine3 = Me.address3
    Forms!carpermit!AddressLine4 = Me.address4
    Forms!carpermit!AddressLine5 = Me.address5


    DoCmd.Close acForm, "Postcode Lookup", acSaveNo

    End Sub

    Thank you

  2. #2
    Join Date
    Feb 2013
    So it works for the [carpermit] if you put the following in the onclick event

    forms![postcode lookup]address1 = me.addressline1
    forms![postcode lookup]address2 = me.addressline2
    forms![postcode lookup]address3 = me.addressline3


    But I would like it to update automatically without clicking on each feild ? any ideas ?

    Thank you

  3. #3
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 17
    It would help if you posted the code that you found. Sometimes sample code from the Internet looks like it would be useful for a given problem, but then goes on to cause other issues down the line.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

  4. #4
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Quote Originally Posted by pjawynn View Post changes all the records address to the one selected in the [postcodelookup]

    ...How can I change only the record in focus...
    I'm a little hazy as to the situation you're describing, but if the problem is that when you change/set the Value of ControlX, on a given Record, that Value appears in ControlX, on all Records, the problem is that ControlX is Unbound!

    To be Record-specific a Control has to be Bound to a Field in the underlying Table/Query.

    If this isn't the situation, please do as weejas requested and post your code. Even better would be to ZIP your file and attach it so that we can look at it, first hand. If you could first save it in 2003 format, before zipping it up, more people will be able to look at it and possibly help you.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Feb 2013

    Please find enclosed Zip file of Database

    Sorry for the late reply have not been well

    Please find enclosed a zip file of the database

    If you open cappermit then click on postcode the postcode search will pop up

    when you enter in the postcode for example gl50 then select an address the car permit form updates all address for all records

    I just need it to change it for the current record

    Can do it from the carpermit vba by putting me.addressline1=forms![postcode lookup]!address1 but can only do it if you click on each line

    Thank you
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts