Hi Everyone
Ok so I have been trying to get this code to work for ages but as a beginner keep getting lost.
I have a form that depending what is in a specific field will display a specific command button to another form.
I have read through and downloaded some of the following code
I have a field called: txtone which is auto populated from other code with either: Aspect Property Solutions Ltd or Conquer Ltd.
I want to display the command button: CmdViewResults when the field: txtone contains: "Aspect Property Solutions Ltd"
and I want to
display the command button: CmdViewResults1 when the field: txtone contains: "Conquer Ltd"
and obviously want the opposite not to appear so only ever one command button displayed on the form.
This is the code I have works OK for first cmd button but nothing happens on second:
thanks
Private Sub Form_Current()
If txtone = "Aspect Property Solutions Ltd" Then
Me.CmdViewResults.Visible = True
Else
Me.CmdViewResults.Visible = False
If txtone = "Conquer Ltd" Then
Me.CmdViewResults1.Visible = True
Else
Me.CmdViewResults1.Visible = False
End If
End If
End Sub
Ok so I have been trying to get this code to work for ages but as a beginner keep getting lost.
I have a form that depending what is in a specific field will display a specific command button to another form.
I have read through and downloaded some of the following code
I have a field called: txtone which is auto populated from other code with either: Aspect Property Solutions Ltd or Conquer Ltd.
I want to display the command button: CmdViewResults when the field: txtone contains: "Aspect Property Solutions Ltd"
and I want to
display the command button: CmdViewResults1 when the field: txtone contains: "Conquer Ltd"
and obviously want the opposite not to appear so only ever one command button displayed on the form.
This is the code I have works OK for first cmd button but nothing happens on second:
thanks
Private Sub Form_Current()
If txtone = "Aspect Property Solutions Ltd" Then
Me.CmdViewResults.Visible = True
Else
Me.CmdViewResults.Visible = False
If txtone = "Conquer Ltd" Then
Me.CmdViewResults1.Visible = True
Else
Me.CmdViewResults1.Visible = False
End If
End If
End Sub