newbie question

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

Michael,

Start by getting the query right. Add the 3 tables to your
query and join the tables by their common fields. Drag all
the field you want in your report onto the query. In the
criteria section under the Company field put something
like [Enter company name you want] and when the query runs
the user will be prompted to enter the company name.

Base your report on this query. Group by Company then by
student then by class (if you want students in each class
rather than classes for each student swap the student and
class grouping) Include a group header on the first two
groupings and put the company name field in the company
header and the student name in the student header and the
class name into the detail section.


HTH,

Terry
 
terry,
thanks! that did help. i think have the query correct and
now i have added a button to the form to print w/, but as
you can guess... i am not there yet. i have tried to as
little inventing as possible to make it easier for the
next person. the only thing i added was the Where
clause...Private Sub cmdPrintReceipt_Click()
On Error GoTo Err_cmdPrintReceipt_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CompanyReceipt2"
stLinkCriteria = "CompanyID= " & Me![CompanyID]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_cmdPrintReceipt_Click:
Exit Sub
Err_cmdPrintReceipt_Click:
MsgBox Err.Description
Resume Exit_cmdPrintReceipt_Click
End Sub
<
with the above, i have to enter the CompanyID and then the
report does not filter on what i entered. i know this is
simple, but i am lost.

also, thanks for the help w/ such a lame description in
the subject.....

tia,
michael

-----Original Message-----
Michael,

Start by getting the query right. Add the 3 tables to your
query and join the tables by their common fields. Drag all
the field you want in your report onto the query. In the
criteria section under the Company field put something
like [Enter company name you want] and when the query runs
the user will be prompted to enter the company name.

Base your report on this query. Group by Company then by
student then by class (if you want students in each class
rather than classes for each student swap the student and
class grouping) Include a group header on the first two
groupings and put the company name field in the company
header and the student name in the student header and the
class name into the detail section.


HTH,

Terry
-----Original Message-----
i have a multiple table database, (company, students,
classes ) i seem to have all the forms working properly.
but now i want to search on a company and print that
record w/ the assocaited students and their classes. can
somebody help shorten the learning curve.
tia,
michael
.
.
 
Micjael,

It looks pretty good to me although I always mess up the
syntax.
Maybe:
stLinkCriteria = "CompanyID= " & Me![CompanyID]
should be .... ?
stLinkCriteria = "[CompanyID]= " & Me![CompanyID]

Anyone else with some suggestions .... ?

HTH,

Terry
-----Original Message-----
terry,
thanks! that did help. i think have the query correct and
now i have added a button to the form to print w/, but as
you can guess... i am not there yet. i have tried to as
little inventing as possible to make it easier for the
next person. the only thing i added was the Where
clause...Private Sub cmdPrintReceipt_Click()
On Error GoTo Err_cmdPrintReceipt_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CompanyReceipt2"
stLinkCriteria = "CompanyID= " & Me![CompanyID]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_cmdPrintReceipt_Click:
Exit Sub
Err_cmdPrintReceipt_Click:
MsgBox Err.Description
Resume Exit_cmdPrintReceipt_Click
End Sub
<
with the above, i have to enter the CompanyID and then the
report does not filter on what i entered. i know this is
simple, but i am lost.

also, thanks for the help w/ such a lame description in
the subject.....

tia,
michael

-----Original Message-----
Michael,

Start by getting the query right. Add the 3 tables to your
query and join the tables by their common fields. Drag all
the field you want in your report onto the query. In the
criteria section under the Company field put something
like [Enter company name you want] and when the query runs
the user will be prompted to enter the company name.

Base your report on this query. Group by Company then by
student then by class (if you want students in each class
rather than classes for each student swap the student and
class grouping) Include a group header on the first two
groupings and put the company name field in the company
header and the student name in the student header and the
class name into the detail section.


HTH,

Terry
-----Original Message-----
i have a multiple table database, (company, students,
classes ) i seem to have all the forms working properly.
but now i want to search on a company and print that
record w/ the assocaited students and their classes. can
somebody help shorten the learning curve.
tia,
michael
.
.
.
 
Back
Top