I know this is probably on the forum somewhere I was unable to find a solution because I didn't really know how to search for it. I have a form that has a combo box on it. The user types a # in the combo and if the number doesn't exist in the record source it asks the user if they would like to create a new record. If the user clicks yes a form frmEnterVet opens for them to enter the new record. What I would like to do is take the value that was typed in the combo box cboVetSearch and have the form frmVetSearch open to a new record with that value in the VetSSN field. I have the form opening but I can't get it to point to a new record with that value.
Open form w/ input from cbo on other form?
Collapse
X
-
One way to do this is to pass the value you need to the openargs parameter of the form you are opening. Once the form is open you can script the append however you want. One way would be (assuming your form is data bound) is to put the following line of code in the on open event of the relevant form:
DoCmd.GoToRecor d acDataForm, Me.Name,acNewRe c
And then set the relevant control to the value of the opened form's openargs
That's a quick and dirty way, not necessarily the most elegant but it should give you some ideas.
Comment