A
Adam
Hi!
I'm trying to print reports based on criteria I enter in
two unbound text boxes on a 'Main Form', one for date,
the other for area code. If I type in a date only, I get
all Daily Jobs for that particular date. I then print
them out. If I enter an area code only, same again, all
Daily Jobs based on the entered area code. I then print
them out.
But what I want to do is specify a date AND an area code
and get all Daily Jobs that match the date and the area
code.
I'm trying to do it this way but to no avail.
The following VB code is attached to command button on
the main form that opens the Daily Jobs form.
stDocName = "Daily Jobs"
stLinkCriteria1 = "[Visit Date]=" & "#" & Me![Date] & "#"
stLinkCriteria2 = "[Area Code]=" & "'" & Me![Area] & "'"
DoCmd.OpenForm
stDocName, , , "[stLinkCriteria1]", "[stLinkCriteria2]"
As this doesn't work what am I doing wrong may I ask?
Thank you for your help
aj
I'm trying to print reports based on criteria I enter in
two unbound text boxes on a 'Main Form', one for date,
the other for area code. If I type in a date only, I get
all Daily Jobs for that particular date. I then print
them out. If I enter an area code only, same again, all
Daily Jobs based on the entered area code. I then print
them out.
But what I want to do is specify a date AND an area code
and get all Daily Jobs that match the date and the area
code.
I'm trying to do it this way but to no avail.
The following VB code is attached to command button on
the main form that opens the Daily Jobs form.
stDocName = "Daily Jobs"
stLinkCriteria1 = "[Visit Date]=" & "#" & Me![Date] & "#"
stLinkCriteria2 = "[Area Code]=" & "'" & Me![Area] & "'"
DoCmd.OpenForm
stDocName, , , "[stLinkCriteria1]", "[stLinkCriteria2]"
As this doesn't work what am I doing wrong may I ask?
Thank you for your help
aj