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.
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.