Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill in multiple fields based on multiple variables

Status
Not open for further replies.

wlwoman

Technical User
Jul 8, 2001
133
US
I have a form with 2 fields that are dependent on the combination of values in 2 other fields. I would like to update the fields using a DLookup or SQL Select query. Details as follows:

Variable Field 1: Size
Variable Field 2: Value

Field 1 to update: Elec
Field 2 to update: Tot

For example:

If Size = C and Value = 1.10, Elec = 14 and Tot = 12
If Size = C and Value = 2.00, Elec = 19 and Tot = 13
If Size = B and Value = 2.00, Elec = 10 and Tot = 12

The Size field is selected first. I have an If-Then-Else code related to the After_Update of the Size field, which updates two other fields not listed here.

The Value field is an entered value depending on the user's whim of the moment. I would like to set something on the After_Update of the Value field that would update the Elec and Tot fields from a table containing Size, Value, Elec, and Tot fields.

Since there are 180 or so possible combinations for the Elec and Tot fields, I don't want to write and if-then-else for the Value field to update the Elec and Tot fields.

I'm out of ideas and running low on sleep. Any good ideas would be greatly appreciated!!!
 
Got it! I used a macro with a SetValue and DLookup expression. Went back and looked at an old post and the lightbulb finally came on [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top