Msg bos syntax

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello there,

I want for a msg box to come up with the msg below if text box is locked.

Please advise on the correct syntax as I am unable to figure it out.

Thanks

Private Sub cmdSet_Click()

If txtINum.Locked = True Then
MsgBox ("Please unlock records first" VBOk, "Travel Unit Database")

Else

On Error GoTo Err_cmdSet_Click
DoCmd.GoToRecord , , acNewRec
txtINum.SetFocus
Exit_cmdSet_Click:
Exit Sub

Err_cmdSet_Click:
MsgBox Err.Description
Resume Exit_cmdSet_Click

End If

End Sub
 
Change the line of code to read:

MsgBox "Please unlock records first", vbOKOnly, "Travel Unit Database"
 
Back
Top