Controlling a form in vba

ZMAN2

Registered User.
Local time
Today, 00:22
Joined
May 6, 2003
Messages
37
Using VBA...

How do I test for a particular open form?

Then

If open, populate a field on that form.

Actually, I don't even need to test if it's open. I just need to populate that field on the form.

DoCmd.Forms!myform![field1] = 1000

I tried using me, but its outside of the form class and it doesn't exist. How do you control a form from another module. I searched and found that it must be declared, but there were limited examples. I need more help than what I came accross.

Thanks in advance:)
 
The form *must* be open and you need to go through the Forms collection:
Forms!YourFormName!YourControlName = 1000
...using your names of course.
 
Thanks

Thanks Rural Guy! I could have sworn that I tried that exact same code and it didn't work:rolleyes: What a noob!

Thanks again.
 
How do you test to see if the other form is open?
 
Hi Banaticus,
Please start a new thread with your question.
 

Users who are viewing this thread

Back
Top Bottom