form to form problem

matt123

Registered User.
Local time
Today, 08:37
Joined
May 11, 2001
Messages
13
I have a form that has one field which actually a combo box from a field on another form. The idea is that my user will only be able to draw off a list of available customers, and if not on the list, they need to go to the customer form and add a new customer. This is done by a command button.
The difficulty is that the new Customer record added on the second form does not automatically become part of the records available on the first form.
Is there a way to make this happen? Or did I not make myself clear enough?
 
Check the Help on Limit to List property and the On Not in List event of the combo box. It will explain more than me trying to do it here.
 
Look at the "Solutions" database it shows you how to do this.
 
You need to requery the combobox after the new record has been added to the table from where the combo box gets its list. In the module for the form with the command button:

Private Sub cmdNewData_Click()
DoCmd.OpenForm "frmAddNewRec"
Me!cmbxAddNewRec.Requery
Me!cmbxAddNewRec.SetFocus
End Sub

I would set frmAddNewRec to data entry and modal. Then when the user has entered the new data and closed the data entry form, the drop down list should display the new addition.

Doug.
 

Users who are viewing this thread

Back
Top Bottom