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

Create default value 1

Status
Not open for further replies.

cramd

Programmer
Mar 28, 2001
214
US
I have two fields HIGHVAL & LOWVAL within my ITEM TABLE. As a user enters an amount in the HIGHVAL field, I need LOWVAL to be 25% of the HIGHVAL. I've tried to create a default value within the expression builder on the LOWVAL field,
"[HighVal]*0.25" - but I get errors while trying this. On the default value of the LOWVAL field, is that where I should be entering my calculation??
cramd
 
You may add code like this in the AfterUpdate event procedure of the HIGHVAL control:
Me.LOWVAL = Me.HIGHVAL / 4

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV
That is exactly what I need. I was thinking wrong, you are right, I need to do it after the HIVAL has been updated. Now can you help get me started? I'm not real familiar with MSACCESS, just give me step one of creating the AFTERUPDATE procedure and I'll take it from there.
Thanks,
cramd
 
So now I figured out how to create an UpdateEvent procedure - I'll attach it to the property on my HIVAL field within the Item form. Now the question is when I import fields into the ITEM table, will the UpdateEvent procedure work from the HIVAL field since I importing data NOT entering data on the ITEM form.
cramd
 
No it won't, but you might consider running an Update Query on the table after you do the Import.

PaulF
 
Paul,
Being new to Access, I was not aware of the Update Query. Found the help topic on Update query and it is exactly what I needed. Thanks for the suggestion.
cramd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top