Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating records on a form (A2000)

    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
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Updating records on a form (A2000)

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating records on a form (A2000)

    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
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Updating records on a form (A2000)

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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