Form Combo Boxes

BobJ

Kestrel - Crawley
Local time
Today, 03:51
Joined
Mar 22, 2007
Messages
47
Hi,

On my Ordering form i have 3 subforms that each have a different table and different products within those tables. I was wondering if it is possible to get the values from these tables (so that they act as default values) but if these values need to be modified, can they be saved to a separate table? i guess if it is possible id need a new table for each subform? Could i enter some code in the after update section to make it save an entry in a different table? or would that still overwrite the value in the table before the after update code could be executed?

Cheers,

Marc.
 
Last edited:
You say you have three subforms, each with different table (recordsource). That's exactly how you do what you're trying to do.

If the tables have proper relationships (already created). A change in the form will cause each of the subforms to tumble to the proper record.

If the tables do not have proper relationships. You have to set the Link Master Field & Child Master Field properties of each subform and requery each on the AfterUpdate Event of their respective Master Field (on the parent main form) to cause the respective subform(s) to tumble to the proper record. Subforms do not necessarily require the same Link Master Field.

Table relationships do a tremendous amount of work for you.
 
i dont think you understand what i mean, ill show you:

Customer A has a contract with my company where Square Tape Cartridge = £50 per tape.

Customer B has a contract with our company where Square Tape Cartridge = £30 per tape

how can i make it so ther £50 appear when that product is selected for any customer but when i change it to £30 for Customer B it doesnt save the change in the table but stores it in a different table.

Right now my relationships are all right, i just need to get information from one table and save the changes to the price in a separate table.

Is that clearer?:s
 
i dont think you understand what i mean, ill show you:

Customer A has a contract with my company where Square Tape Cartridge = £50 per tape.

Customer B has a contract with our company where Square Tape Cartridge = £30 per tape

how can i make it so ther £50 appear when that product is selected for any customer but when i change it to £30 for Customer B it doesnt save the change in the table but stores it in a different table.

Right now my relationships are all right, i just need to get information from one table and save the changes to the price in a separate table.

Is that clearer?:s

When you change the price of the contract, you need the price has updated to the other table, too. Is this right?
To do this, you can write some code for the Form_AfterUpdate event procedure. For example:
CurrentDB.Execute "UPDATE tblStoreTable SET Price = " & [txtPrice] & " WHERE CustomerID = " & [txtCustomerID] & " And ProductID = " & [txtProductID]

I use the Execute method to run an action query by sql statement.
The aboved statement means:
Update the Price field of the tblStoreTable to the value contained in the textbox named txtPrice in form where is the same customer and same product in the modified row.
I wonder that this help you something ?
 
yeah thats right, but i want the original price to stay the same in the record source
 

Users who are viewing this thread

Back
Top Bottom