Reading info from form to report/query

Ean James

Registered User.
Local time
Today, 22:23
Joined
Nov 9, 2005
Messages
14
Im making a student database that holds information about students and the modules they are taking.

On my student entry form I wish to have a button that will read the current student number shown on screen and place it in my query to make their timetable? I understand that this can be done through VBA but I dont have a clue where to start?

In my query I have done this:

WHERE (((tblLink.StudentNo)=[Enter Student Code]));

I have made it so that when the report is clicked it asks for the student number in an input box.

Any ideas?

Thanks very much in advance

Ean
 
You do this with VBA but if you add the below to the query criteria it will work for you as long as you have your form open

[Forms]![FormName]![ControlName]

FormName=Name of your form
ControlName=Name of the control that displays the data on your form
 
Hi Keith

Thanks 4 your reply,

So the controlName would be the name of the StudentNo field on the form?

Then I could just have a button that opened the report and the report would take the information from the open form?

That would work because the button is on the form so it would have to be open to be clicked! Is that right?

Sorry if I sound stupid, I just like to clarify so I understand properly

Thanks
 
ContolName is the name of the contol on your form that is displaying the value of the StundentNo field. Not the actual name of the field in your table.
Using a buttons on click event sound like a good way to open your report to me.
 

Users who are viewing this thread

Back
Top Bottom