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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a query from a form

Status
Not open for further replies.

JimmyRa

Programmer
Nov 20, 2003
4
GB
I have a 'query form' which asks the user for dates, some codes, etc, and then runs a query based on these. The query uses [ >= GetStartDate() and <= GetEndDate() ] functions to retrieve the screen entries. Worked fine for a while, but now gives me a 'last operation was cancelled' messagebox every time I hit the RUN button on screen.
Any ideas where to start.
 
Jimmy:

Are you referencing the form's controls in the query or are you building the query using SQL?

If you are referencing the form controls make sure you fully qualify the reference:

Forms!frmName.ctrName

If you are using SQL, make sure you bracket the date fields with pound signs:

" . . . >=#" & ctrName & "# and <=#" & ctrName & ". . ."

HTH

Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top