Hello, All
I am trying to create two option buttons Option32 and Option34 what I would like to happen is if both are clicked making them -1 a message to pop up and tell the user to choose either optionbutton not both. Then once the ok button displayed at the bottom of the message is pressed it resets both Option34 and Option32 to 0 or False respectively. However when just Option32 is choosen it pulls up another form to fill out. This is what I have thus far........ Have not gotten to the form part still kind of new to programming in visual basic so any help would be greatly appreciated. Thanks in Advance.
Private Sub Option32_AfterUpdate()
If Option34.Value = -1 & Option32.Value = -1 Then
Dim Msg, Style, Title, Help, Ctxt, Response
Msg = "Can not have both options chosen. Click Yes or No" ' Define message.
Style = vbOKOnly + vbCritical + vbDefaultButton1 + vbApplicationModal
' Define buttons.
Title = "Error" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbOKOnly Then ' User chose Yes.
Me.Option32.Value = 0
Me.Option34.Value = 0
End If
End If
End Sub
Not sure where I am going wrong compiled and everything but in the view form when I go to test it does not work.