Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2008

Tip: Looking for answers? Try searching our database.

syntax error missing operator

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jlute@marzetti.com - 30 Jun 2008 14:27 GMT
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!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.