IF form is Readonly

CEH

Curtis
Local time
Yesterday, 23:21
Joined
Oct 22, 2004
Messages
1,187
I should be able to find the answer by searching here... But havent had any luck. Pretty simple question, just don't know the correct syntax.
I have started using a form as a Menu instead of the switchboards. I have a form that one command opens in "Add" mode the other opens same form in "Readonly" mode.
What I cant seem to find is how to code... "If this form is open in "Whatever" mode... THEN...
Example....
Menu has DoCmd.OpenForm stDocName, , , , acFormReadOnly, acWindowNormal, stLinkCriteria
Now on the form it opens I want certain command buttons to only be visible when open in certain modes... So on that forms "onload" event... (I'm guessing "onload" correct me if it should be another event)... I need to have something like

If (Form is open in Readonly) THEN
cmd.whateverButton.visible = False
end if

So, what command gives me the (Form is open in readonly) part?


Thanks
 
You could use OpenArgs. On the button that opens the form, in whatever mode, you would do:

DoCmd.OpenForm "frmName", , , , , , 1

The on the OnOpen event of the form do

If Not IsNull (me.openargs) then
Select case me.openargs

case 1

me.yourbutton.visible = true

case 2

Me.yourbutton.visible = false

End select
End if
 
Thanks

Thanks,I'll give it a shot.
 

Users who are viewing this thread

Back
Top Bottom