Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer data from macro query to form field

Status
Not open for further replies.

Mered1284

Technical User
Joined
Mar 16, 2009
Messages
4
Location
US
I am working on a database that stores student records.

From the switchboard, when a user selects "enter data" I want a window to pop up asking the user to input the student id number. If the student id number is already in the student table I want the student information form to pop up in edit mode - populated with the student's information. If the record id number is not in the student table, I want the form to pop up the same way (in edit mode) but I want the student id number that the user already entered to be transferred to the form so that the user does not have to retype it. How do I go about doing this?

I started with a macro that runs the query and opens the form with the student's information. If the student id is already in the table the form opens just like I want it to but if the student id number is not in the table, the form opens blank and the student id number has to be re-entered.

I'm new so the more details the better - thank you so much!
 
You should be able to set the value or default value in the newly opened form. I'm not at all sure how to do this with a macro since I almost always use code.

Duane
Hook'D on Access
MS Access MVP
 

You could run an append query to add the student id to the table before opening the form. Then, open it the same
way you do when the id is in the table.

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top