I'm getting this error and it's regarding this:
DoCmd.OpenReport "rptPKWeightCalculatorASSsFGs", acPreview, , _
"[PKWTID] = " & Me!PKWTID
The problem is that values in [PKWTID] can contain non-alphanumeric
characters, underscores, etc. such as:
PKWT100050_6/12FLOZBTGLCLPLLAPAPER
The underscore and the front slash trigger the error.
What can I change in the code to relieve this?
Thanks in advance!!!
jlute@marzetti.com - 30 Jun 2008 14:42 GMT
Please disregard. I got it with:
Dim stDocName As String
Dim strWhere As String
strWhere = "[PKWTID] = """ & _
Forms![frmQueryPKWTCalcsFGs]![PKWTID] & """"
DoCmd.OpenReport "rptPKWeightCalculatorASSsFGs", acPreview _
, , strWhere
Allen Browne - 30 Jun 2008 14:43 GMT
If you open your table in design view, what is the Data Type of the PKWTID
field?
If Text, try:
DoCmd.OpenReport "rptPKWeightCalculatorASSsFGs", acViewPreview, , _
"[PKWTID] = """ & Me!PKWTID & """
If Number, try:
DoCmd.OpenReport "rptPKWeightCalculatorASSsFGs", acViewPreview, , _
"[PKWTID] = " & Val(Nz(Me!PKWTID, 0))

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I'm getting this error and it's regarding this:
>
[quoted text clipped - 11 lines]
>
> Thanks in advance!!!