473,385 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,385 software developers and data experts.

run-time error 3075

Hi all the error I am receiving in Access 2007 is as above with
Syntax error (missing operator) in query expression
'CIGlobal_CONTRACT.CIGlobal_aID =`.

When I debug it has this
rivate Sub cmdPrint_Click()
Dim rst As Recordset

If IsNull(Me!lstCIGlobals) Or Me!lstCIGlobals = "" Then
MsgBox " No document selected.", vbExclamation + vbOKOnly, "Select a document"
Exit Sub
End If

strSQL = "SELECT CI.* FROM CIGlobal_CONTRACT INNER JOIN CI ON (CIGlobal_CONTRACT.CNT_NUM = CI.CNT_NUM) AND (CIGlobal_CONTRACT.CIGlobal_aID = CI.CIGlobal_aID) where CIGlobal_CONTRACT.CIGlobal_aID = " & Me!lstCIGlobals.Column(7)
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)

If rst.EOF Then
Exit Sub
Else
rst.MoveFirst
Do Until rst.EOF
DoCmd.OpenReport "rptCI", acViewPreview, , "CNT_NUM = '" & rst!CNT_NUM & "' AND CI_NUM = '" & rst!CI_NUM & "'"
Do While IsReportLoaded("rptCI")
DoEvents
Loop
rst.MoveNext
Loop
End If
Mar 26 '10 #1
1 1161
Stewart Ross
2,545 Expert Mod 2GB
Hi. When you next try to run this use the VBA Editor immediate window to check the value of Me!lstCIGlobals.Column(7). This is the value you are inserting into your WHERE clause, and the error message you quote is telling you there is no value being returned for that column.

I am assuming that you are expecting this value to be numeric; if it is a text value you will need to use single quotes on either side of the point at which you insert the value, like this:

" ... where CIGlobal_CONTRACT.CIGlobal_aID = '" & Me!lstCIGlobals.Column(7) & "'"

Columns are numbered from 0, so column(7) refers to the 8th column within the listbox concerned.

-Stewart
Mar 27 '10 #2

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

Similar topics

3
by: leroybt.rm | last post by:
Can someone tell me how to run a script from a interactive shell I type the following: >>>python filename >>>python filename.py >>>run filename >>>run filename.py >>>/run filename >>>/run...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
19
by: Bryan | last post by:
How can i run a bit of code straight from the IDE? Right now i make a temporary button and put the code behind that, then i run debug mode and click on the button. Is there a way to highlight...
9
by: Brett Wesoloski | last post by:
I am new to VS2005. I changed my program.cs file to be a different form I am working on. But when I go to run the application it still brings up the form that was originally declared as new. ...
7
by: Lee Crabtree | last post by:
I remember when I was first getting into .NET Forms programming that there was a rather emphatic rule about not constructing a form before calling Application.Run with it. So this: ...
8
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? --...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
7
by: mxdevit | last post by:
Task: run application from ASP.NET for example, you have a button on ASP.NET page, when press this button - one application is invoked. the code to run application (for example, notepad) is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.