Macro to create automation.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a very basic question, and any help would be appreciated. I have a
really good understanding of Access with the exception of Macros.

I am attempting to create a macro which would take an entire population and
make it so it will only show a table where a field is equal to a criteria
provided by the user. I am assuming this can either be done by asking the
user to supply a parameter or by selecting it from a drop down. I would
prefer the interface to be entirely push button or selecting from a drop down
so as to recude the amount of input the user actually needs.

I know VBA would be a less complicated way of going about this, however I
have very minimal experience with that and assumed that it would be easier
for my level to used Access.

Any insight or help would be greatl;y appreciated. Thanks.
 
L T Mattern,

In Access, what you are referring to as "drop down" (I think) is called
a combobox.

VBA would not be a less complicated way of doing this.

You need to put an unbound textbox, or combobox, or whatever other
appropriate control, on a form, for the user to enter the criteria value.

You then need to make a query, based on your table, and in the Criteria
of the field in question, you refer to the control on the form using
syntax like this...
[Forms]![NameOfForm]![NameOfControl]

Then, you need to make a form (continuous view, probably), based on this
query.

Then you need to make a macro, with the OpenForm action, and nominate
the form that is based on the query.

Then, on the first form (the one with the criteria entry control), you
could put a command button, and on the On Click event property of the
command button, you neter the name of the macro.

That's it. Open the first form, enter your criteria as required, click
the button, and the second form should open displaying the selected records.
 
KC,

It appears that your computer's system clock is seriously out of sorts.

I would not generally recommend the use of Parameter Queries.
 
Create a query that addresses the tables you want data from. Enter one of
more parameter fields in the query design panel. When you run the query,
maybe from a button on your form, access will pop up one or more message
boxes asking for the value of each parameter. There will be a seperate
message box for each parameter. After the user has filled them in, Access
will execute the query based on the parameters given. For info on Parameter
Queries enter "Parameter query" in the help file index of access.
 
Back
Top