SetValue in form on opening

G

gg

I want to set the value in a field in a form with a macro
that opened the form. I always get a message that access
can't find the field. Yet, if I actuate that same macro
with a command button on the form, it works fine. Please
help-going nuts.
 
N

Newbie

Where are you tiggering the macro from?
Is the form already open?

I think you need to open the form then set the values
eg
docmd.openform "frmProblem"
forms!frmProblem!txtControl.value = "whatever"

HTH

Ali
 

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