Show button on form if value is...

Elmobram22

Registered User.
Local time
Today, 21:59
Joined
Jul 12, 2013
Messages
165
Hi all,

I'm after showing a button to cover some other buttons when a combo box has a certain value. I am using this code but am missing something...

Private Sub Combo7_AfterUpdate()
If "1" Or "2" Then
Me.[Command21] = Visible = True
End If
End Sub

When I do it says...

Run-time error '438':
Object doesn't support this property or method

Any ideas?

Cheers,

Paul
 
The correct syntax is:
Code:
Private Sub Combo7_AfterUpdate()
    If Me.Combo7.Value = 1 Or Me.Combo7.Value = 2 Then
        Me.Command21.Visible = True
    Else
        Me.Command21.Visible = False
    End If
End Sub
 
The correct syntax is:
Code:
Private Sub Combo7_AfterUpdate()
    If Me.Combo7.Value = 1 Or Me.Combo7.Value = 2 Then
        Me.Command21.Visible = True
    Else
        Me.Command21.Visible = False
    End If
End Sub

Brilliant thanks so much!! :D:D
 

Users who are viewing this thread

Back
Top Bottom