473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Syntax Error

I am getting the following error when I click on a command button.

Runtime error 3075
Syntax error (missing operator) in query expression "[jobinvoiceid]'=.


I have a main form "fmjob" with a subform "fmjobinvoice"
both are linked together by "jobId" and "jobinvoiceid"

I have a command button with on the click handler:
Private Sub Command1158_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "rptjobinvoice", acViewPreview, , "[jobinvoiceid]=" & JobinvoiceID

End Sub

what I am trying to do is open up a report to view a specific record.

I have this in a few places in my DB on my main forms only not on the subforms and it works fine.

I have worked this a ton of different ways and can't seem to come up with the fix.

thanks for any suggestions.
Gary
Jul 22 '09 #1
4 1188
missinglinq
3,532 Expert 2GB
This syntax

"[jobinvoiceid]=" & JobinvoiceID

is only correct if the jobinvoiceid field is defined in your table as a Number. Is it?

IF it's defined as Text then

"[jobinvoiceID] = '" & JobinvoiceID & "'"

would be correct.

Where is Command1158 located and where is JobinvoiceID located, form-wise?

Linq ;0)>
Jul 22 '09 #2
JobInvoiceID is defined in my table as a "AutoNumber"


Command Button 1158 is placed on the subform "fmjobinvoice" not the main form "fmjob"

"JobInoviceID is placed in the subform "fmjobinvoice" not the main form "fmjob"
Jul 22 '09 #3
ChipR
1,287 Expert 1GB
What is the exact text in the error message you are getting?
"[jobinvoiceid]'=.
Either the error message or your code has not been transferred correctly.
Jul 22 '09 #4
OldBirdman
675 512MB
Could JobinvoiceID be Null? That would fit the error message. How about Debug.Print JobinvoiceID?
Jul 22 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. ...
1
by: Donald Canton | last post by:
Hi, I'm using Bjarne's book to learn C++ and am stuck on the Calc program in Section 6. Everything works fine except when I try to use istringstream to parse a token from the command line. I...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
2
by: david | last post by:
Anyone could give me a hand about this syntax error? Thank you. David Source Code: Dim conn As New SqlConnection(strConn) Dim daAngio As New SqlDataAdapter(strSelectStatement, conn) 'Create a...
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
1
by: Hari Sekhon | last post by:
I've written an except hook into a script as shown below which works well for the most part and catches exceptions. import sys def myexcepthook(type,value,tb): do something ...
7
by: Josh | last post by:
I have a lot of except Exception, e statements in my code, which poses some problems. One of the biggest is whenever I refactor even the triviallest thing in my code. I would like python to...
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
6
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
5
Banfa
by: Banfa | last post by:
So I have a little problem, I have a template class and that class contains a template function; now what I want to do is declare that function in the class (or indeed the entire class) as a friend...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.