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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating fields

Status
Not open for further replies.

Rjconrep

Technical User
Oct 24, 2000
66
US
When a selection is made in one field I want two other fields to automatically fill in based on what is in a table. I have a table with four fields.
1. id field
2. the type of mailing
3. the cost per piece
4. the makeready cost

In my form when the type of mailing is selected I want number 3 (cost per piece) and number 4 (makeready) to automatically fill in for me. How do I do this?
I need these two fields for a calculation.
Quantity * cost + makeready = total cost
 
Go to the top of this screen. Do a Keyword search on "Automatically Fill In". You will get several answers that fit just about every scenario of this issue. This question has been asked a lot.

B-)

Good luck. ljprodev@yahoo.com
ProDev, MS Access Applications
 
On the OnChange property of the typeofmailinglist field, add some code to do the assignments.

i.e.

me!cost_per_piece = expression1
me!makeready = expression2

(assuming cost_per_piece and makeready are the names of your form fields and where expression1 is the calculation for cost per piece & expression2 is the calculation for makeready.)

Hope this helps...

JJ
 
Check out the dLookup() function

dlookup("[costeachfield]","tablename,"Id = " & me.idfield)

or you can fill the fields using DAO,ADO or SQL
 
Thanks for your help everyone but I am a newbie and I don't know how to apply dlookup. What exactly do I do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top