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