Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries, forms and check Boxes

Status
Not open for further replies.

bjjazzyjones

IS-IT--Management
Jun 5, 2002
7
AU
I would like to create a query that will modify its results based a a check box associated with a field on a form.

IE if a user wants their results to be based on a date field, they would check a box, and the query return results based on that check box and field.

How do I do that?
 
I think what you want is something like

Dim strSQL As String

strSQL = "SELECT * FROM tblTableName "


If tickBox Then
strSQL = strSQL & "WHERE dateField .. .. etc. .. .. ;"
Else
strSQL = strSQL & "WHERE .. .. some other criteria .. ;"
End If

DoCmd.RunSQL strSQL




Does that help ?

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top