run time error 3075.

G

Guest

Private Sub Item_No_AfterUpdate()

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strsql As String


strsql = "SELECT * HAVING Project= " & [Forms]![NDrawing Entry]![Project] &
" AND Partition= " & [Forms]![NDrawing Entry]![Partition] & " AND Section= "
& [Forms]![NDrawing Entry]![Sect] & " AND [Sub Section]= " &
[Forms]![NDrawing Entry]![Sub Sect] & " AND [Drawing No]= " &
[Forms]![NDrawing Entry]![Drawing No] & " AND Type= " & [Forms]![NDrawing
Entry]![Type] & " AND Item No= " & [Forms]![NDrawing Entry]![Drawing
Items].[Form]![Item No] & " AND Rev= " & [Forms]![NDrawing Entry]![Revision]
& ";"

Set db = CurrentDb()
Set rs = db.OpenRecordSet(strsql)

If Not rs.EOF Then
rs.MoveFirst
Me.Supplier = rs![Supplier]
Me.Quantity = rs![Quantity]
Me.Status = rs![Status]
Me.Due_Date = rs![Due Date]
Me.Category = rs![Category]
Me.W_O_No = rs![W/O No]
Me.P_O_No = rs![P/O No]
Me.P_O_Line_No = rs![P/O Line No]
End If

rs.Close
End Sub



The above code is getting a run time error 3075.

Syntax error (missing operator) in query expression. It then goes on to list
the 7 variables along with their values in sql format, but for some reason
the word select is omitted from the from of the code

i.e

* having project =wbf AND partition = A AND...

Help please someone, what is this error and what is causing it. is there a
site with a list of run time errors for access and what causes them?

It would save asking alot of questions
 
G

Guest

Your first line should read...

strsql = "SELECT * FROM YourTable WHERE Project= ".....
 
G

Guest

hahaha

thank you so very much

ive been working on this problem for days now, well not specificly this
problem, but this code. i must have accidently deleted the table ref :p

it was there once i swear :p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top