• Updating records on a form (A2000)

    Author
    Topic
    #358656

    Hi, I am new to access and have no programming or VB experience, please be gentle with me and do not get to techy, thanks.

    I have a customer combo on a form, when I select a record it auto completes 5 text boxes that make up the address etc. (text box 1 = [customer].column(2) and so on for each text box).

    What I want to do is if there is a new record I want to be able to go to my customers records make a new record and then update the original form I was working on.

    I have managed with some help to get part of the way by adding a notonlist event in the combo box which opens my customers form. Here I can create a new record.

    My problem is that when I return to my other form the new record does not appear in the drop down. If I close and then re-open the form it is there.

    Can anbody tell me how I can make it that I do not have to close the form and go back to it.

    TIA

    Steve

    Viewing 0 reply threads
    Author
    Replies
    • #535643

      You have to requery the combo box, which means it goes out and recreates the dropdown list. It only takes a simple line of code:

      Me.yourcontrolnamehere.requery

      I think the Access help contains some sample code in the NotInLIst event.

      • #536125

        Thanks Mark

        I have just returned to the Uk for 2 weeks leave hence the tawdry response. Sadly I have had to leave my DB behind, before you all cry foul I have left feeding and watering instructions behind.

        As I already have a notonlist event in the combo box (to open my Customer form) do I just add this line of code to the end of it, if yes do I use a seperator of any sort.

        TIA

        Steve

        • #536158

          Exactly what is in your NotInList event now? That is, what is the entry in the property sheet next to NotInList. Does it say [Event Procedure]? If not, then you need to make it say that, and move whatever is in there into the event procedure. You can then add that requery as another line of code.

    Viewing 0 reply threads
    Reply To: Updating records on a form (A2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: