View Full Version : Selection of value for a query in a macro


Berggeit
01-29-2010, 12:24 PM
Hi, i'm new in access. i'm using access 2002 in wizard mode.:)
I have made a query report.
In the macro which prints the report with a reportprint action. has a selection value in the
WHERE-format. like [queryname]![FieldName] = "Jansen"
It works fine.
But i want to build a macro which ask for the name and use it the WHERE-format of the reportprint action in the macro.

Can did be done?:confused::confused:

pbaldy
01-29-2010, 12:42 PM
I'm not sure if it's possible in a macro, as I don't use macros, only code. That said, most of us would use a form to gather the user input anyway, since you have more control there. Then your condition would look like:

FieldName = Forms!FormName.ControlName

Berggeit
01-29-2010, 01:24 PM
hi Pbaldy,
Thanks for your quick replay.
I did that with a table but then the Dbase engine coms up with
do not recognise [TblName]![Fieldname]:confused:

if i do it with a form:
has the form to be open to point to the field?
A form has to be stored before y can point to the field?

if you create a field an a form how is it called?
where can i find its name in the specs?

You understand i'm a beginner with this.

pbaldy
01-29-2010, 02:21 PM
Yes, the form would have to be open. The syntax would look like what I posted earlier. You can use the build feature to navigate to it as well.