I have a database with a form in it, i dont want to use the automatic buttons to go back and forth through records because i need it to run an if statement even time it is pushed, the problem is i need to include provision for errors with the button. This is the code i have so far:
Private Sub Command32_Click()
DoCmd.GoToRecord , , acNext
If Me.Type_of_care = "other" Then
Me.Insurance_code.Enabled = False
ElseIf Me.Insurance_code = " " Then
Me.Insurance_code.Enabled = False
Else: Me.Insurance_code.Enabled = True
End If
End Sub
The docmd command is to just get the next record, the if statement checks to see whether an iput box is enabled it very simple atm. The problem is that when a problem occurs, it goes to the debug menu, this is a problem for my end user as they have limited computer skills.
Thank in advance.
Private Sub Command32_Click()
DoCmd.GoToRecord , , acNext
If Me.Type_of_care = "other" Then
Me.Insurance_code.Enabled = False
ElseIf Me.Insurance_code = " " Then
Me.Insurance_code.Enabled = False
Else: Me.Insurance_code.Enabled = True
End If
End Sub
The docmd command is to just get the next record, the if statement checks to see whether an iput box is enabled it very simple atm. The problem is that when a problem occurs, it goes to the debug menu, this is a problem for my end user as they have limited computer skills.
Thank in advance.