Finding a field in VBA

Hemish

Registered User.
Local time
Today, 20:13
Joined
Jan 20, 2005
Messages
65
Hi can anyone please help me.

What I’m trying to do is on a form there is a check box, if the check box

ChkGW = -1 then I want a price to appear in a text box txtGWP

The price is in a table called “PS_tblSettings”, the field name is sName. In the field sname there are lots of records I want to find the record “giftwrapcost” and get the price from the field sValue.

How would this be written in VBA in MS Access 2000.

I appreciate your help thankyou
 
Short of writing the code for you... here is a pointer to get you started...

Use the AfterUpdate event of your check box (ChkGW).

If the user has cleared the checkbox, then clear out the target text box, (you didn't explicitly say you want this behaviour, that is a presumption on my part).
Otherwise assign the result of a DLookUp to your text field.

Help on Dlookup should be fruitful for you, post back after reading that, if you need further help.
 
Just like to say thanks, not sure how i forgot about Dlookup. Thanks once again
 

Users who are viewing this thread

Back
Top Bottom