Aug 20 2007, 01:52 PM
I have a form that has several combo boxes on it. As the user makes various choices, 2 text boxes automatically fill in with a Code and a Description.
One of the combo boxes is asking for a Code, which the user would type in. If that code isn't in the table, however, the NotInList event fires and opens the GP form to key in the description (as the code was picked up from the open args).
Is it possible to avoid the GP form and just have the code and description automatically append to the table it needs to be in and populate the code combo box?
Aug 20 2007, 01:53 PM
If you don't open the form, how is the description going to be entered?
Aug 20 2007, 02:02 PM
The description is comprised of the various combo boxes on the main form.
The user chooses Species, Grade, Thickness, Length, Sort, and Machining. From these choices made, 1 text box generates a GP Code in this fashion: RO04SB12EXXR. The description is also generated by their choices in this fashion: 4/4 SB RED OAK 12' XX ROUGH in another text box.
I would like any new generated codes/descriptions to automatically go into the tblGP, versus having the users type the Code on one form (the one we're talking about) and the Description in the other form that comes up on the NotInList event.
Or, if this is not possible, have the description picked up like the code is via the open args.
Thank you for your help!
Aug 20 2007, 02:44 PM
Now it sounds like you're storing two calculated values, since both description and code can be calculated from the components or vice versa
Aug 20 2007, 03:00 PM
You're right, they are and can be calculated at any time. However, they also need to be hard coded because of our accounting system. These codes/descriptions will be the basis of setting the accounting system up correctly (as it's a mess right now with no rhyme or reason to how they established codes/descriptions before). Once the majority of the codes are properly set up, no more codes will be allowed into the systems (access and accounting software).
To speed data entry, I set up the text boxes to "calculate" the code/description based on what was agreed upon by management.
The GP table has some other fields that can be filled in at a later date (general ledger codes, avg costs), etc. By getting these codes/descriptions in as the inventory is keyed in, we'll be able to attach the correct general ledger code to them in the GP table.
Otherwise, I would have to attach the general ledger code to every single item, versus just the GP Code. The GP codes cannot be duplicated, whereas we may have several thousand items being exactly the same. The GP code is easier to understand and recognize than the general ledger code. Am I wrong in my thinking here?
So, back to my original question, is it possible to have both the code and description be inserted into the GP table when a new code is generated without having to go through another form? Or have both the code and description show up in the form with open args?
Aug 20 2007, 03:54 PM
Yes. Use CurrentDb.Execute on an SQL Append statement to just add the data to the table.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here