jt643
Technical User
- Jun 17, 2003
- 144
I am having a tough time figuring out the correct syntax to pull back all records from a table that have a yes/no box checked on a table.
I thought the following would work:
Set SelTotalTableDb = CurrentDb
Set SelTotalTableRst = SelTotalTableDb.OpenRecordset("select * from COSelTotalTable WHERE Contract = 'Yes'")
I also tried:
stSQLWhere = "Yes"
Set SelTotalTableDb = CurrentDb
Set SelTotalTableRst = SelTotalTableDb.OpenRecordset("select * from COSelTotalTable WHERE Contract = stSQLWhere")
I keep getting the following error message:
Run-Tim Error '3061': Too few parameters. Expected 1
*It is 'Expected 2' when I try the string syntax above.
Thanks in advance!
I thought the following would work:
Set SelTotalTableDb = CurrentDb
Set SelTotalTableRst = SelTotalTableDb.OpenRecordset("select * from COSelTotalTable WHERE Contract = 'Yes'")
I also tried:
stSQLWhere = "Yes"
Set SelTotalTableDb = CurrentDb
Set SelTotalTableRst = SelTotalTableDb.OpenRecordset("select * from COSelTotalTable WHERE Contract = stSQLWhere")
I keep getting the following error message:
Run-Tim Error '3061': Too few parameters. Expected 1
*It is 'Expected 2' when I try the string syntax above.
Thanks in advance!