Rowena
Registered User.
- Local time
- Today, 11:04
- Joined
- Jul 16, 2002
- Messages
- 27
Greetings,
I have searched the forums, and can't seem to find the solution to my problem.
I have a form for each customer, and a subform for jobs done for them. Each customer can have an unlimited number of individual jobs. I have designed a report which prints a job sheet for the customer, showing the relevant address info and such, which also prints the jobs sorted so the most recent job is printed at the top of the report.
Currently, I have a button that opens the jobsheet query, and another button to print the jobsheet report. To print the job sheet, a user has to run the query, go into design view, put in the customer's first and last names, save the changes, then print the job sheet report.
This is a tiny bit too cumbersome for folks to put up with for long. What I would like to do is have a button to press that would print the current customer record with all the relevant job records.
I have tried putting in some of the code that folks have recommended to others asking similar questions to mine, and I get syntax errors that I don't know how to fix. Currently my non-working button code is:
Private Sub Command79_Click()
DoCmd.OpenReport"[JObSheetReport]",,,"[CUSTID]="&Me.CUSTID"
End Sub
where CUSTID is the numeric primary key for the customer. (Yes, the report name is really spelled like that... :-| )
I have very little experience with Visual Basic, and would appreciate any light you knowledgeable folks can shed on this matter!
Thanks in advance,
Rowena
I have searched the forums, and can't seem to find the solution to my problem.
I have a form for each customer, and a subform for jobs done for them. Each customer can have an unlimited number of individual jobs. I have designed a report which prints a job sheet for the customer, showing the relevant address info and such, which also prints the jobs sorted so the most recent job is printed at the top of the report.
Currently, I have a button that opens the jobsheet query, and another button to print the jobsheet report. To print the job sheet, a user has to run the query, go into design view, put in the customer's first and last names, save the changes, then print the job sheet report.
This is a tiny bit too cumbersome for folks to put up with for long. What I would like to do is have a button to press that would print the current customer record with all the relevant job records.
I have tried putting in some of the code that folks have recommended to others asking similar questions to mine, and I get syntax errors that I don't know how to fix. Currently my non-working button code is:
Private Sub Command79_Click()
DoCmd.OpenReport"[JObSheetReport]",,,"[CUSTID]="&Me.CUSTID"
End Sub
where CUSTID is the numeric primary key for the customer. (Yes, the report name is really spelled like that... :-| )
I have very little experience with Visual Basic, and would appreciate any light you knowledgeable folks can shed on this matter!
Thanks in advance,
Rowena