Hi
I keep getting type Mismatch with the following code ( The bold section after "[Est No] = " & JN.
I think the 0 is a tect property.
Dim stDocName As String
Dim JN As String
JN = InputBox("Please Enter A Valid Job Number", "")
DoCmd.OpenReport "Fleet Referral", acViewNormal, , "[Est No] = " & JN And "[Supp] = '0'"
Print Report
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
Print Report
Cheers ...
Dave.
Dave.
-
- Administrator
- Posts: 78789
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Print Report
Hi Dave, the quotes are not quite correct.
If Supp is a text field:
DoCmd.OpenReport "Fleet Referral", acViewNormal, , "[Est No] = " & JN & " And [Supp] = '0'"
If it is a number field:
DoCmd.OpenReport "Fleet Referral", acViewNormal, , "[Est No] = " & JN & " And [Supp] = 0"
If Supp is a text field:
DoCmd.OpenReport "Fleet Referral", acViewNormal, , "[Est No] = " & JN & " And [Supp] = '0'"
If it is a number field:
DoCmd.OpenReport "Fleet Referral", acViewNormal, , "[Est No] = " & JN & " And [Supp] = 0"
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
Re: Print Report
Hi Hans
I knew it was the quotes, they're confusing.
It was a number field and works fine.
Thanks again.
I knew it was the quotes, they're confusing.
It was a number field and works fine.
Thanks again.
Cheers ...
Dave.
Dave.