Macro button on Form

G

Guest

I have a form on which I am attempting to add a control button which when
clicked on will run a macro and return the value in a field on the form. I
need for the macro to look at the source table and get a count for how many
records are in that table with specific criteria. Here is my formula for
that:
=dcount("[control number]","treasury controls","[cycle code]='d'")
I have tested the formula in a regular text box and it works. Next I
created a button on my form and entered the above formula as the code for my
macro attached to the command button. Here is where my problem occurs, I get
an error message. I want to have the result of the macro returned in a text
box on my form. Any help is greatly appreciated.
 
G

Guest

hi,
i'm confused.
you said you tested the dcount in a text box and it worked.
why do you need the macro???
 

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