Value of Form Variable is Blank

R

Robert T

Hello:

I'm new to Access and was trying to figure out how to copy a field value
from Form A to Form B. Klatuu did his best to help me but the expression
didn't work. Now I think I've figured out why the expression didn't work, the
variable vStudentID was null.

But I can't figure out why the variable I created is null. I must be missing
something very obvious to regular Access users.

On a form based upon tblStudents, I created a button. In the on the click
event for the button, I wrote the following code:

Dim vStudentID as String

vStudentId = me.StudentID
I also tried vStudent = me.StudentID.value

In the immediate window I put a question mark before the variable name while
the form was still open, and when I hit enter, there was no value.
?vStudentID - I then hit the Enter Key and the cursor moved the next line.
However, the line was blank.

Please advise what I'm doing wrong.

Thanks,
Robert
 
Top