So I have a few Queries already written and my goal is to have a user input certain fields that would change the way the Query is returned, basically having the user change 2 or 3 parameters of the original Query.
First, I'm having problems getting a Query to execute in VBA:
Private Sub QResultButton_Click()
DoCmd.OpenQuery (Readings2009, acViewPreview,acReadOnly)
End Sub
[Readings2009 is a Query I created in Access] This returns a syntax error.
I have also see this done:
strSQL = "SELECT Readings2009.id, Readings2009.othercolumn, Readings2009.another
WHERE Readings2009.something > today() ..."
DoCmd.RunSQL (strSQL)
I can't get either to work. Any help would be greatly appreciated.