Question Controling from properties from another form

M4RK 1

New member
Local time
Today, 23:18
Joined
Dec 7, 2008
Messages
7
I'm new to this forum and Access but have done lots of DB work in VB6 using Access tables.

The two don't seem to mix in Access as there are things like Docmd instead of code I'm used to in VB6. As a result I'm stuck on a few things which are probably simple.

I have a button which is hidden when the form opens normally. I need to be able to make it visible when I open the form Modally from another form. In VB6 its easy. frmname.cmdOK.Visible = True

I haven't found the question answered by Googling it. I see things like
FORMS!Myform!["Table"].["Control"].. blah blah, and I can't get it to work. It looks a lot of typing for nothing and Intellisense doesn't list what I want.

Could someone please put me right. I must have spent a solid 8 hours trying to find this answer.

Thanks
Mark
 
Try

Code:
Forms!frmname!cmdOK.Visible = True

Check this link for the correct syntax for referencing forms
 
Thanks both but I'm getting errors with this syntax. It can't find the form referred to. There's no typos in the code either
 
What is the error you are getting?

Another thought is possibly to use OpenArgs to control this button. For instance, the calling form passes an argument, let's call it "A" to the opened form. In the On Open event of the called form it can analyze the argument. If OpenArgs = "A" Then Do X, Select Cases, etc.

-dK

EDIT: I am unsure, but once the new formed is opened (unless in modal?) then the code processing on the calling form is halted unless the focus is returned. I am sorry, but I had this problem once and forget how I resolved it but remember it had something to do if the form was in pop-up or modal. Maybe someone can enlighten ....
 
DoCmd.OpenForm "Form2", acNormal, "", "", , acNormal
Forms!Form2!Command0.Visible = True

Works and Form2 is pop up and modal
 

Users who are viewing this thread

Back
Top Bottom