quaked2023
Technical User
Hello!
I'm trying to get a DBGrid control to display only the records that i want to display... i found this page and gave me an idea of how to do it... but instead of putting the SQL statement in the rocordsource property i put it like this:
Private Sub Command1_Click()
sqlstr = "SELECT Date, Pay FROM Payments WHERE Payments.Code = Label10.Caption"
Data1.RecordSource = sqlstr
Data1.Refresh
End Sub
but every time i try to do it i get run-time error '3061' Too few parameters. Expected 1... What am i doing wrong?... I should mention that i've never used SQL before...
Thanks in advance!
-The Only Privacy Left Is The Inside Of Your Head!- QUAKED2023
I'm trying to get a DBGrid control to display only the records that i want to display... i found this page and gave me an idea of how to do it... but instead of putting the SQL statement in the rocordsource property i put it like this:
Private Sub Command1_Click()
sqlstr = "SELECT Date, Pay FROM Payments WHERE Payments.Code = Label10.Caption"
Data1.RecordSource = sqlstr
Data1.Refresh
End Sub
but every time i try to do it i get run-time error '3061' Too few parameters. Expected 1... What am i doing wrong?... I should mention that i've never used SQL before...
Thanks in advance!
-The Only Privacy Left Is The Inside Of Your Head!- QUAKED2023