Save records in a Table with a Formula updated

E

ElPatrontj

I have a 5 fields in a Form that they contain formulas they are update when I
actualize other field linked with the five fields, I want that the
information of these fields are save in a table after updated.

Can somebody help to apply this in my data base?

These are the field I have in my form, as I said before, when I change my
part number the others fields are updated.

Part Number
Part ID
UoM
Unit Cost
Ext. Cost
Sum all Cost

Thanks for your help.
 
C

Chegu Tom

Put a button on the form that does an append query. ( I am assuming that
Part Number is numeric and Part ID, and UoM are string)
Your sql Statement stored in something like strSQL

strSQL="INSERT INTO YourTableName (Field1, Field2, [Field 3] ) SELECT " &
[me].[part number] & ", '" & [me].[Part ID] & "', '" & me.UoM & "'"
docmd.runsql strsql, false


Note the single quotes needed to for the text fields but not for the numeric
field

Also note that if you use spaces in your field or control names you need to
put them in square brackets [].
In the future use names like PartNumber or Part_Number

if
Product ID = 23456
Part ID="Brake Lining"
UoM="yes"
strSQL will print as INSERT INTO YourTableName (Field1, Field2, [Field
3] ) SELECT 23456, 'Brake Lining', 'yes'





The append query appends to fields in a table from fields in the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top