Text Entry and Macros

G

Gaijintendo

I have been using square brackets to prompt users for text entry e.g. [Enter
Thing Name:], in my queries.

Now I am hoping to combine a few queries in a macro and would like to know
if there is a way to use a single point of text entry for multiple queries.

I have tried searching for answers, but I don't know what the use of square
brackets is called.
 
B

BruceM

I think you would find information about the square brackets either under
Parameter or Criteria. I don't know about using macros to do what you want,
but you can use an unbound form (I will call it frmCrit, with text boxes
txtStartDate and txtEndDate. In a query the parameter for a date field
would be:
Between [Forms]![frmCrit]![txtStartDate] And [Forms]![frmCrit]![txtEndDate]

If you are opening a form bound to the query rather than opening the query
directly you can have a command button open frmCrit (which could be a pop-up
form). After making the selection, the click event of a command button for
opening the form frmMain could be:

Me.Form.Visible = False
DoCmd.OpenForm "frmMain"

In any case, as long as frmCrit is open you can use controls on the form as
criteria.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top