If the user finds that the data required is not in the combo box .

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If the user finds that the data required is not in the combo box, how can I
make a button to open a form, related to the appropriate table, which they
may use to add the new data.or how can I make them able to add new data to
the list of combo box?
 
Use the DblClick event of the combo (or the Click event of a command button
beside the combo) to open another form where the user enters the new value
into the table that feeds the combo. Then in the AfterUpdate event of that
form, requery the combo.

Example:
Private Sub Combo1_DblClick(Cancel As Integer)
DoCmd.OpenForm "MyOtherForm",,,,acFormAdd
End Sub

Private Sub Form_AfterUpdate()
Forms!Form1!Combo1.Requery
End Sub


It is also possible to use the NotInList event of the combo to add the data
directly to its RowSource table. This is a good solution where the combo's
bound column is not hidden, so the data you type into the combo is the
actual value to be added to the lookup table, and there are no other fields
the user needs to enter. Details in this article:
NotInList: Adding values to lookup tables
at:
http://allenbrowne.com/ser-27.html
 
Back
Top