|
Thread: SQL
-
Jan 31st, 2000, 05:05 AM
#1
Thread Starter
Addicted Member
I'm using Combo box to fill in a and b in the Sql statment. Then I click the commannd button and I get this error "To Few Parameters. Expected 1" in the SQL statment. My brain is fried I have seen this error before but I can't figure it Can sombody help.
Private Sub Command1_Click()
Dim a As String
Dim db As Database
Dim dbs As Recordset
Dim Sql As String
Dim b As String
b = cmbMonth.Text
a = cmbDate.Text
Sql = "Select * from " & b & " where DayM= '" & a & "'"
Data1.DatabaseName = "txtPath"
Data1.Refresh
Set db = OpenDatabase(txtPath)
Set dbs = db.OpenRecordset(Sql)
Set Data1.Recordset = dbs
dbs.Close
db.Close
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|