Search form when closing gives warning of..

brandi.m99

New member
Local time
Today, 10:20
Joined
Jul 28, 2015
Messages
8
I have a "Search" form that I am using to search through a query in a list box of all of my Customers. Once the record that I am wanting to view comes up I highlight it and click a "View" button to bring up another form with the customers full record. When this form is open I am able to update the customer information and add User's to it if necessary.
My problem comes after I click on my save and close button that takes me back to me search form. I want to close the search form and the error I get is "The record cannot be deleted or changed because table "tblUserProfile" includes related records." I click OK and get a SECOND error stating "You can't save this record at this time. MS Access may have encountered an error while trying to save a record. If you close this object now, the data changes you made will be lost. Do you want to close the database object anyway?"
I have already made my changes and saved them in the form with the customer record so am not sure why I am getting an error when trying to close the Search form.

Any thoughts or suggestions would be great!!
 
Usually you have some unbound controller in which you enter what you search for and display the result in a subform or the like.
I think you make the search directly in the table / query using bound controller and therefore you get these error messages.
 
I have two unbound search boxes for a ID and Customer name. The results are displayed in a list box that has a query the search is running.
My list box is bound to the ID and allows me to bring up the customer I highlight in another form for the whole customer record. Is there a different way to make that action happen without unbounding the List box?


(Please tell me if I am making no sense!!)
 
My list box is bound to the ID and allows me to bring up the customer I highlight in another form for the whole customer record. Is there a different way to make that action happen without unbounding the List box?
You don't need to bind the ListBox. You are using the data displayed in the list to find a record, not to set or get the value of a field in a table, so make sure the RecordSource property of your search form is blank, and make sure the ControlSource of the ListBox is also blank. Nothing about your search process needs to be bound.
 
Hi Markk! I have done that and yes the search works, BUT(and I know its my inexperience) the only way I have been able to click on a record from the search and click on my view button to bring up that specific record in a separate form is to have the list box control source be the ID. I would love to know if you know of another way to accomplish this!
 
How do you open the Customer form from the search form? Can you show the code?
 

Users who are viewing this thread

Back
Top Bottom