Need help please?

fatboy95

Registered User.
Local time
Today, 07:44
Joined
Apr 2, 2002
Messages
43
I have two tables Student Info Table and Block Comments Table. The tables are connected using a autonumber key from Student Info Table:StudenID using the relationship table

I want the be able to open up a form based on the Block Comments Table by the StudentID so that I can have just the Block Comments for that student. Can someone please help me with this? Thank you!

If you want you can ICQ me at 110578879
 
You can add a combo box to the form using the Wizard and select the 3rd item on the first screen, "Find a record...". This will allow you to find the studentsID and when you leave the combo box the selected students data will be displayed on the form. Or you can have another form and use the DoComd.Openform method to open the form to the selected StudentID.
 
When the Block Comments form opens up I need it to automatically know which student I am putting comments in for. So I guess I need it to be able get the StudentID from the Student Info Form when I push the button to open up the Block Comment Forms. Hope this helps explain better what I am trying to do... Thanks for you input....
 
DoCmd.OpenForm "FormName", , ,"[StudentID] = " & Me.StudentID

Use this in the command button to open the form or create the command button to open the form using the Wizard and it will create the above code for you.... The code above assumes you have a field called StudentID on the open form and it is numeric.

[This message has been edited by Jack Cowley (edited 04-03-2002).]
 
I tried what you said and also this and it is still a no go for me....

rivate Sub OpenBlockCommentForm_Click()
On Error GoTo Err_OpenBlockCommentForm_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Block Comment Form"

stLinkCriteria = "[StudentID]=" & Me![StudentID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_OpenBlockCommentForm_Click:
Exit Sub

Err_OpenBlockCommentForm_Click:
MsgBox Err.Description
Resume Exit_OpenBlockCommentForm_Click

End Sub

I don't understand why this won't work. Do you have any other suggestions for me... thanks alot for your help... it is apprecitated...
 
I assume the code above was created by the Wizard when it made the command button, right? Then I cannot guess as to why this is NOT working. Do you get any errors? What happens when the form opens? I am about to pack it in so if you want to email me directly I will try and sort it in the morning....
 

Users who are viewing this thread

Back
Top Bottom