Results 1 to 4 of 4
  1. #1
    Seven is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2009
    Posts
    8

    updating a control

    I have a form which has a combobox. Next to the combo is a button. when the button is hit it will open another form for data entry.

    if the combobox is empty, then the button will open a form and start a new record

    if the combobox has a value in it, then the button will open a form to the correct record (corrosponding to the combobox value)

    the form that the button opens modifies the table that the combobox data
    is picked from.

    all of this works as expected. now for the question :

    when the user returns to the original form, how do I get the combobox to 'update' the available values from the table that the other form just modified? ( I prefer to not do this as i close the other form, but rather put some code in to update the combobox when the original form regains focus ) for example, if the user creates a new record, and then closes the form, the combobox does not have the new record as a choice.....



    something like

    on event gainfocus : me.mycombobox.rebuild your list()

    any help would be greatly appreciated!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why not just put a Me.ComboBoxName.Requery in the GotFocus event of the ComboBox? Then every time you enter the cbo, it will requery.

  3. #3
    Seven is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2009
    Posts
    8
    will give it a try on monday. thanks for the assist!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Another method would be to use the acDialog argument in the OpenForm command to stop the code in the first form. Then make the next line force the cbo to requery.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Updating a Combo Box
    By DaughanP in forum Forms
    Replies: 3
    Last Post: 12-04-2009, 08:52 AM
  2. Updating a query
    By bailey537 in forum Programming
    Replies: 1
    Last Post: 07-16-2009, 10:30 AM
  3. Auto updating a total
    By Dreamcatcher in forum Forms
    Replies: 0
    Last Post: 06-19-2009, 02:18 AM
  4. Query not updating
    By timbim in forum Queries
    Replies: 0
    Last Post: 11-16-2008, 09:46 AM
  5. Sending control to specific control
    By wasim_sono in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums