Adding data to Combo box

  • Thread starter Thread starter Intoxification
  • Start date Start date
I

Intoxification

I've made a form with several combo boxes. If the data is not available in
the combo box, the user can hit a commande button which will bring him to
another form (2). This form(2) will enable the user to enter the required
information, which will be stored in a seperate table. After entering this
data, the user returns to the orginal form. But it seems that the new data
is not listed in the combo box, while it's already stored within the table.
I thought this could be solved by adding the following code to the combo
box:

Private Sub gvb_bk_nickname_GotFocus()
Me.Refresh
End Sub

But this didn't work properly. Ok, the combobox contained the new data, but
Access started giving alrert messages telling that alle required fields
haven't been filled in. This is completely normal as the combox is
appearing in the middle of the form. Is there anybody out here who has any
idea how this can be solved. I can do it by changing all the required
fields into non-required, but this would give a program that doesn't fulfill
all the requirements :(
So I should find a way to refresh / update the combobox, without checking
the required fields on the form.

Many thanks,

Hendrik Taveirne
Credit Controller
Glaverbel SA
Brussels
Belgium
 
I will assume that there is a command button "OK" or
something similar that the user clicks in order to close
your Form2. For our purposes we'll call it cmdOK on Form2
and your combo box on Form1 we will call combo1 for now.
Try this:

Private Sub cmdOK_Click()
Forms!Form1!combo1.Requery
End Sub

This will refresh this combo box's list values and allow
the user to continue to fill out the rest of the fields.
Hope this is what you were looking for.
 
Back
Top