Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable a button on form open

Status
Not open for further replies.

emtenzer

MIS
Nov 14, 2001
50
US
I am using macros on a customized menu in Access 2007. I have the same form being opened from 2 different macros and in one case, I want a command button on the form to be disabled. Is this possible? If not using the macro, can I do it in vba?
 
You may consider OpenArgs

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
What I don't know how to implement would be the "condition". I only want the button disabled if the form is being opened by one of two macros. I tried using the "Where Condition" on that macro but that didn't work.

Where = forms!frmDailySummary!cmdPostData.Disabled = True
 
I talked about the 7th parameter of the Docmd.OpenForm method, not the 4th.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
In the code to open this form, I have:

Private Sub Command16_Click()
DoCmd.OpenForm "frmDailySummary", , , , , , "Recalculate"
End Sub


In the OnOpen event of the form I have:

If OpenArgs = "Recalculate" Then
Me.cmdPostData.Enabled = False
Else
Me.cmdPostData.Enabled = True
End If


This isn't working. Thanks.
 
I'd use the Load event pocedure.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top