kcolbert01
07-09-2004, 04:33 PM
I have a form that has all of the job descriptions in my company. Each job code has anywhere from 5 - 20 tasks which causes a problem when formatting in the report because there is too much space when there aren't a lot of tasks for the particular job code. So I have created 2 reports - one with the amount of tasks being under 12 and the other has all job codes with more than 12 tasks. Still with me??
Ok I have a field in the job description table called "LongJD" - it's a Y/N field that lets me know if the tasks are more than 12. So in my form I have this code on the print button:
Dim strReportName As String
Dim strWhere As String
If Me.LongJD = -1 Then
strReportName = "RptJobDesc_Main_Acct>12"
strWhere = "[JobCode]=" & JobCode
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport strReportName, acPreview, , strWhere
Else
strReportName = "RptJobDesc_Main_Acct<12"
strWhere = "[JobCode]=" & JobCode
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport strReportName, acPreview, , strWhere
End If
I get a "Enter the parameter value" and the job code i am trying to print is right under the message - like it's not reading the Job Code. I even enter the job code to see if that will work but it doesn't. Can anyone tell me what I am doing wrong? I'm so close....
Thanks in advance!
Ok I have a field in the job description table called "LongJD" - it's a Y/N field that lets me know if the tasks are more than 12. So in my form I have this code on the print button:
Dim strReportName As String
Dim strWhere As String
If Me.LongJD = -1 Then
strReportName = "RptJobDesc_Main_Acct>12"
strWhere = "[JobCode]=" & JobCode
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport strReportName, acPreview, , strWhere
Else
strReportName = "RptJobDesc_Main_Acct<12"
strWhere = "[JobCode]=" & JobCode
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport strReportName, acPreview, , strWhere
End If
I get a "Enter the parameter value" and the job code i am trying to print is right under the message - like it's not reading the Job Code. I even enter the job code to see if that will work but it doesn't. Can anyone tell me what I am doing wrong? I'm so close....
Thanks in advance!