Open Form from subForm

R

Ripper

I have a subform that I want to add buttons to to open other forms with a
specific ID field.

subDiscReferral has several fields, but the1 field I need to use is studentID.

How do I set a button to open a form with a specific studentID? I know how
to set an OnClick event of the studentID field using stWhere =
"[StudentID]=" & Me![txtStudentID], but I can't get the ID to move over to a
button to open another form. Anyone willing to help?

Access 2000
 
O

Ofer

Did you try writing in the command button

dim stWhere as string
stWhere = "[StudentID]=" & Me![txtStudentID]
docmd.OpenForm "FormName" ,,,stWhere
 
R

Ripper

Thanks Ofer. I am a !@#$!@# Idiot. I mispelled student. This was KILLING
ME!!!!!!
--
Thanks As Always
Rip


Ofer said:
Did you try writing in the command button

dim stWhere as string
stWhere = "[StudentID]=" & Me![txtStudentID]
docmd.OpenForm "FormName" ,,,stWhere

Ripper said:
I have a subform that I want to add buttons to to open other forms with a
specific ID field.

subDiscReferral has several fields, but the1 field I need to use is studentID.

How do I set a button to open a form with a specific studentID? I know how
to set an OnClick event of the studentID field using stWhere =
"[StudentID]=" & Me![txtStudentID], but I can't get the ID to move over to a
button to open another form. Anyone willing to help?

Access 2000
 
Top