Hey all,
I am sorry for bothering everyone with this, as I feel it should be easy, but it is just not working.
I have an imbedded SQl query in VBA on the Onclick property of a button;
If IsNull(Me.Combo9) = True Or Me.Combo9 = "" Then
MsgBox "Please select from the list!", vbOKOnly, "Missing Data"
Me.Combo9.SetFocus
Exit Sub
End If
Dim db As Database, rst As Recordset, sql As String
sql = "SELECT * FROM IBSData WHERE [InternalNumber/AppropriationTitle] = '" & Me.Combo9 & "'"
Set db = CurrentDb
Set rst = db.OpenRecordset(sql)
Me.Combo9 = ""
Exit_Run_Click:
Exit Sub
Err_Run_Click:
MsgBox Err.Description
Resume Exit_Run_Click
But when I try to run this I get a "Too few paremters, expected 1" which doesn't make sense.
All I want to do is have the resulting SQl query show on the screen as a datasheet. I have no idea why this is not working.
Help?
I am sorry for bothering everyone with this, as I feel it should be easy, but it is just not working.
I have an imbedded SQl query in VBA on the Onclick property of a button;
If IsNull(Me.Combo9) = True Or Me.Combo9 = "" Then
MsgBox "Please select from the list!", vbOKOnly, "Missing Data"
Me.Combo9.SetFocus
Exit Sub
End If
Dim db As Database, rst As Recordset, sql As String
sql = "SELECT * FROM IBSData WHERE [InternalNumber/AppropriationTitle] = '" & Me.Combo9 & "'"
Set db = CurrentDb
Set rst = db.OpenRecordset(sql)
Me.Combo9 = ""
Exit_Run_Click:
Exit Sub
Err_Run_Click:
MsgBox Err.Description
Resume Exit_Run_Click
But when I try to run this I get a "Too few paremters, expected 1" which doesn't make sense.
All I want to do is have the resulting SQl query show on the screen as a datasheet. I have no idea why this is not working.
Help?