I have a form1 with a textbox for a name (as well as other textboxes) and a command button which will move the form to a new record. After the textbox is filled out, a query is run to determine if the name exists in the table. If so, a modal form opens up and lists the name in a listbox (this listbox will display other information as well to differentiate different names in the event there are multiple records with the same name but different addresses, ages, etc.). After selecting the name from the listbox a filter is run to populate the form1 with the information from the table so the user doesn't have to fill out the entire form. If the user then clicks the command button on form1 to open a new record and enters a new name, the above process repeats itself. Only after selecting a name from the listbox on the modal form, form1 is populated with the information from the first name. It's as if I have opened a recordset with the filter from the modal form and it's still open when I move to a new record on form1 so that when the filter is run for the second time, it's still using the original recordset as the filter. If this is the case, I don't know the code for opening or closing the recordset. If it matters, my filter is based on a query and the listbox on the modal form is unbound as I don't need to store the information anywhere. Here is the code from the modal form (a command button on the modal form is clicked to run the following code):
cmdbtn1_Click()
docmd.selectobject acform, "form1"
docmd.applyfilter "qryname"
docmd.gotocontrol "controlname"
docmd.close acform, "modalformname"
Any thoughts (and code) on this would be greatly appreciated. Thanks in advance.
cmdbtn1_Click()
docmd.selectobject acform, "form1"
docmd.applyfilter "qryname"
docmd.gotocontrol "controlname"
docmd.close acform, "modalformname"
Any thoughts (and code) on this would be greatly appreciated. Thanks in advance.