I have an option group on a continuous form, where if the value = 2 already (on loan), I want it to either give a message saying that the machine is out on loan and cannot be edited via this form, OR to completely disable the option group for that machine.
The way I've done it so far is:
This appeared to work okay, but now it's giving me the msgbox when I open the form. Is there a way of saying:
Have played around with
[/code]If Me.OnOpen then
Exit Sub
Else ...[/code]
but get Run-time error 13, Type mismatch.
Does anyone know how to get round this please? Any suggestions gratefully received. (Using A'97)
The way I've done it so far is:
Code:
Private Sub Form_Current()
Select Case Me.fraMachStatus
Case 2
msgbox "Machine is out on loan. _
You cannot change status here.", _
vbExclamation, "Restricted Action"
Me.AllowEdits = False
Case Else
Me.AllowEdits = True
End Select
End Sub
This appeared to work okay, but now it's giving me the msgbox when I open the form. Is there a way of saying:
Code:
If form is being opened Then
don't Run Current Event
Else
Run Current Event
End If
Have played around with
[/code]If Me.OnOpen then
Exit Sub
Else ...[/code]
but get Run-time error 13, Type mismatch.
Does anyone know how to get round this please? Any suggestions gratefully received. (Using A'97)