By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,365 Members | 3,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,365 IT Pros & Developers. It's quick & easy.

VB Report - Run time error-2147217900-(80040e14)

P: 1
When i run the report its showing runtime error in this line as.... (Syntax error -
missing operator in query expression)

DataEnvironment1.rsCommand1.Open ("select * from GRNTrans where SUPPLIER NAME = " & Combo1 & " AND GRNDate between # " & DTPicker1 & "# and # " & DTPicker2 & "# ")


//Dim DB As Database
Dim Enq As Recordset
Private Sub Cancel_Click()
Unload Me
End Sub

Private Sub Form_Load()
Set DB = OpenDatabase(App.Path + "\Material Management.mdb")
Set Enq = DB.OpenRecordset("SUPPLIER")
Call LoadSUPPLIER
Combo1.Visible = True
End Sub
Private Sub ShowReport_Click()
DataEnvironment1.rsCommand1.Open ("select * from GRNTrans where SUPPLIER NAME = " & Combo1 & " AND GRNDate between # " & DTPicker1 & "# and # " & DTPicker2 & "# ")
DataReport1.Show
DataReport1.ZOrder (0)
End Sub

Public Function LoadSUPPLIER()
Combo1.Clear
If Enq.RecordCount <> 0 Then
Combo1.Visible = True
Enq.MoveFirst
Do While Not Enq.EOF
Combo1.AddItem Enq.Fields(1)
Enq.MoveNext
Loop
Else
Combo1.Visible = False
End If
End Function//

Kindly send me the solution
Oct 23 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 274
I think you should use
' " & Combo1 & " ' insead " & Combo1 & " because name isn't numeric.
Oct 23 '07 #2

Post your reply

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