insanity
Monkeys do the work!
- Local time
- Today, 21:57
- Joined
- Jan 8, 2002
- Messages
- 14
Hi experts!
I'm a bit stumped on this one. I am dynamically building a SQL string to load a forms recordset. I've set up 4 checkboxes which filter the data on two fields (set Yes/No).
Each field has three options, True/False, False/True, or All Records (Either True/True or False/False) - I've set False/False to All Records as the data to either be extract or not extracted!
I have the following code to set the strings, this is one for Extracted, then another for Uploaded (not pasted)
I have the following code to build the SQL string.
It works fine when there is a True/False but when I try to select True/True or False/False it doesn't like "*".
Can anyone please point me in the right direction to overcome this or an alternative method?
Thanks.
Peter
I'm a bit stumped on this one. I am dynamically building a SQL string to load a forms recordset. I've set up 4 checkboxes which filter the data on two fields (set Yes/No).
Each field has three options, True/False, False/True, or All Records (Either True/True or False/False) - I've set False/False to All Records as the data to either be extract or not extracted!
I have the following code to set the strings, this is one for Extracted, then another for Uploaded (not pasted)
Code:
If Me.chkoptExtracted = True Then
If Me.chkoptNotExtracted = True Then
strExtracted = "*" ' both true, select all (show all)
Else
strExtracted = True ' ext = true, notext = false
End If
Else
If Me.chkoptNotExtracted = True Then
strExtracted = False 'ext false, notext true
Else
strExtracted = "*" ' ext = false, notext = false (show all)
End If
End If
I have the following code to build the SQL string.
Code:
strSQL = "SELECT * FROM tblValidUpload" _
& "WHERE ((Uploaded = " & strUploaded & ") AND Extracted = " & strExtracted & ") ORDER BY CostCentre;"
Can anyone please point me in the right direction to overcome this or an alternative method?
Thanks.
Peter