Pathetique
Registered User.
- Local time
- Today, 04:22
- Joined
- Sep 18, 2002
- Messages
- 29
I have a very specific problem with synchronizing two combo boxes on a form. The form name is "Time Book" and contains about 8 fields (all required), of which only two are combo boxes. Their names are "Job ID Code" and "Job Name". Currently, the user picks a "Job ID Code" and the choices in the "Job Name" box are automatically limited to the ONE job name that is associated with that unique job id code (a fairly common form technique). These associations are in a table called "Work Orders". The form writes to a table appropriately called "Time Book". Below I've listed some pertinent properties for the combos:
For the "Job ID Code" combo:
Row Source Type: Table/Query
Row Source: SELECT [Work Order].[Job ID Code] FROM [Work Order];
For the "Job Name" combo:
Row Source Type: Table/Query
Row Source: SELECT DISTINCT [Assigned Job ID Codes Query].[Job Name] FROM [Time Book], [Assigned Job ID Codes Query] WHERE ((([Assigned Job ID Codes Query].[Job ID Code])=[Forms]![Time Book]![Job ID Code]));
Here is the problematic scenario:
A user chooses a Job ID Code, then selects the Job Name. Everythings cool. However, the user then realizes they meant to choose a different Job ID Code, so they choose a different one. Everything's still cool. Then, without checking, the user (having already selected the previously associated Job Name) doesn't select the newly associated Job Name, and proceeds through the form, tabbing through to the point where the record is saved and the form is reset, ready for another record to be entered. Everything appears cool (to the user). But, in the table the incorrect Job Name appears, the one that was originally selected.
I've tried the Limit to List property, I've made a requery macro and put it in seemingly every possible event, and numerous other schemes that I can't remember right now. But, nothing prevents the problem. You can tell that it is doing it by choosing an item from combo1 and choosing a corresponding item from combo2, then changing combo1, checking the drop down menu in combo2, and then changing combo1 back to your original choice, and finally noticing that the old item from combo2 is still selected.
The only thing I can come up with for a solution is maybe I could create a default selection for the "Job Name" combo, so that when the form is requeried or reset, the selection for that field is also reset. But as of yet, I cannot figure out how to force a default selection on a combo box that gets its values from a table. What have you datamasters?
Path
For the "Job ID Code" combo:
Row Source Type: Table/Query
Row Source: SELECT [Work Order].[Job ID Code] FROM [Work Order];
For the "Job Name" combo:
Row Source Type: Table/Query
Row Source: SELECT DISTINCT [Assigned Job ID Codes Query].[Job Name] FROM [Time Book], [Assigned Job ID Codes Query] WHERE ((([Assigned Job ID Codes Query].[Job ID Code])=[Forms]![Time Book]![Job ID Code]));
Here is the problematic scenario:
A user chooses a Job ID Code, then selects the Job Name. Everythings cool. However, the user then realizes they meant to choose a different Job ID Code, so they choose a different one. Everything's still cool. Then, without checking, the user (having already selected the previously associated Job Name) doesn't select the newly associated Job Name, and proceeds through the form, tabbing through to the point where the record is saved and the form is reset, ready for another record to be entered. Everything appears cool (to the user). But, in the table the incorrect Job Name appears, the one that was originally selected.
I've tried the Limit to List property, I've made a requery macro and put it in seemingly every possible event, and numerous other schemes that I can't remember right now. But, nothing prevents the problem. You can tell that it is doing it by choosing an item from combo1 and choosing a corresponding item from combo2, then changing combo1, checking the drop down menu in combo2, and then changing combo1 back to your original choice, and finally noticing that the old item from combo2 is still selected.
The only thing I can come up with for a solution is maybe I could create a default selection for the "Job Name" combo, so that when the form is requeried or reset, the selection for that field is also reset. But as of yet, I cannot figure out how to force a default selection on a combo box that gets its values from a table. What have you datamasters?
Path