By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

Stop a form from updating a table

P: 12
Hi all- I'm currently using a form to look up records based on a few fields. Problem is, it's overwriting the first record in the table! Is there a way to avoid this, or should I write code to restore the original value every time a search occurs? (It's not every time a search occurs, but whenever the record is no longer being edited, whether in form view or when it's clicked away from in the table itself.)
Jun 30 '15 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 31,768
I'm afraid that's only happening because you've designed your form wrong.

Have a look at Example Filtering on a Form and Cascaded Form Filtering for help doing it as you'd want it to work. There should never be any situations where the existing data gets updated as part of the search/filter process.
Jun 30 '15 #2

P: 12
Sorry, don't know if I was unclear or if I'm just not understanding the given links... I have a form that consists of 5 dropdown menus. The top one uses an SQL query to get all of the distinct values in the manufacturer field of a table. The second gets all distinct values in the supplier field that also have the selected manufacturer. The next gets all the part numbers with those manufacturer and supplier values. There isn't any code on these comboboxes except to requery when something changes.
Also, how does one make unbound comboboxes...? Very sorry...
Jun 30 '15 #3

Expert Mod 15k+
P: 31,768
My suspicion, and only that at this point, is that you're using bound controls and that's what's causing your problem. A bound control is any one that has a value in the .ControlSource property that specifies a field from the form's recordset (That which the form is bound to via its .RecordSource property).

Also, how does one make unbound comboboxes...?
To convert a bound control to an unbound control it is simply necessary to remove any value from the .ControlSource property. What this means in a practical sense is that whenever a new value is entered into, or selected from, this control it will have no effect on any existing data. IE. No changes will be made to data through changing or selecting any values in this control.
Very sorry...
Please don't be. Not knowing all the details is where we all start from. It's a sensible starting position. It's where we go from there that matters - and even then only if it's a subject we're interested in.
Jul 1 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.