Set VBA variable the value of a field in a table? (Easy question)

N

Nitrogen666

Hey,

This is pretty much my first time using Access (I have only been usin
it for a matter of hours) and i've come onto a small problem.
Basically, in VBA code, how can i give a variable the value of
specific field in a table?

So far i have been able to work out this much:

-SELECT tblSubject.[Subject Reference Code], tblSubject.[Grade A] FRO
tblSubject WHERE (((tblSubject.[Subject Reference Code])=" & Chr(34)
Combo20 & Chr(34) & "));-

Now, if i put the above code into the RowSource of a combo box on
form it works. However, i can't figure out how to use the above cod
so that the returned value goes into a VBA variable. (Setting
variable the value of the combo box is not an option)

I hope i have explained myself clearly and that this will be easy fo
someone to answer.

Thanks
 
K

Ken Snell

Check out the DLookup function in Help. It's designed to return the value of
a single field of a single record.
 

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