populating a form

M

Mark

Hi,

I have two forms. The first is a form that has a
calander, in which the user selects a date range
(beginning date and an ending date). Then the user clicks
a command button labeled "view classes". I have code in
the "On Click" property of the view classes button...
among which I have it to open up my second form
labeled "classes" (here is where users can register for
classes).

I have a problem with some additional code. Also in
the "On Click" property I would like to run a query that I
have created (it asks for the user to enter
their "Employee ID" number). I used the following code:

Dim stQryName As String
Dim stDocName As String
Dim stLinkCriteria As String

'Runs query
stQryName = "queryEmployeeNameBox"
DoCmd.OpenQuery stQryName, acNormal, acEdit
'Opens form
stDocName = "formClassRegistrationByCalendar"
DoCmd.OpenForm stDocName, , , stLinkCriteria

I have two questions:
1. On my query, I have four fields (EmployeeID,
EmployeeFName, EmployeeLName, EmployeePhoneNumber). I am
having trouble getting these four fields to be populated
on my "classes" form after the user clicks the view
classes button on the first form and enters their Employee
ID (from the query). Do I get these fields to populate
from the first form or do this on the second form?

2. After I close the second form... the query that was
opened is being shown on the screen. Is there a way not
to have it displayed? Or should I not go about this task
this way?... perhaps just creat a subform on the second
form which is not visible and have the fields be populated
this way?

Any suggestions would be greatly apreciated. Thanks!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top