mjdemaris,
As you requested, here is the code of my program I am developing. If you will notice, I have changed the problematic field names mentioned above previous message into : [SEQUENCE OF EVENTS], [STATUS NORMALIZED], [STATUS BEING NORMALIZED], [STATUS UNDER SHUTDOWN], [OTHERS 2], [NAME ORIGINATOR], and [DATE PREPARED]. About Allen Browne's locking bound controls (not included in this code), I am still working to simply include in the lock button these mentioned problematic field names upon the opening of form. Only this, I need to fix from this code. I posted below brief codes where the problematic field names are located. Thank you.
_________________________________________________________________
Option Compare Database
Private Sub Combo62_AfterUpdate()
End Sub
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
Private Sub Combo5_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me!Recordset.Clone
rs.FindFirst "[INCIDENTREPORTSEQNO] = " & Str(Nz(Me![Combo5], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Command302_Click()
Command76.Enabled = False
INCIDENTREPORTSEQNO.Locked = True
[DATE].Locked = True
[CATEGORY].Locked = True
[AREA].Locked = True
[UNIT NO].Locked = True
[EQUIPMENT].Locked = True
[TIME].Locked = True
[TRIP].Locked = True
[FIRE].Locked = True
[DUMP].Locked = True
[RUPTURE].Locked = True
[EXPLOSION].Locked = True
[OTHERS 1].Locked = True
[POWER LOSS].Locked = True
[WATER LOSS].Locked = True
[PROPERTY DAMAGE].Locked = True
[PERSONAL INJURY].Locked = True
[OTHER CAUSE].Locked = True
[POWER GEN PRIOR TO INCIDENT].Locked = True
[POWER GEN AFTER THE INCIDENT].Locked = True
[WATER PROD PRIOR TO THE INCIDENT].Locked = True
[WATER PROD AFTER THE INCIDENT].Locked = True
[SEQUENCE OF EVENTS].Locked = True
[STATUS NORMALIZED].Locked = True
[STATUS BEING NORMALIZED].Locked = True
[STATUS UNDER SHUTDOWN].Locked = True
[OTHERS 2].Locked = True
[NAME ORIGINATOR].Locked = True
[DATE PREPARED].Locked = True
MsgBox ("All Data has been locked .... ")
End Sub
Private Sub Command303_Click()
' ask for password
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
Exit Sub
End If
INCIDENTREPORTSEQNO.Locked = False
[DATE].Locked = False
[CATEGORY].Locked = False
[AREA].Locked = False
[UNIT NO].Locked = False
[EQUIPMENT].Locked = False
[TIME].Locked = False
[TRIP].Locked = False
[FIRE].Locked = False
[DUMP].Locked = False
[RUPTURE].Locked = False
[EXPLOSION].Locked = False
[OTHERS 1].Locked = False
[POWER LOSS].Locked = False
[WATER LOSS].Locked = False
[PROPERTY DAMAGE].Locked = False
[PERSONAL INJURY].Locked = False
[OTHER CAUSE].Locked = False
[POWER GEN PRIOR TO INCIDENT].Locked = False
[POWER GEN AFTER THE INCIDENT].Locked = False
[WATER PROD PRIOR TO THE INCIDENT].Locked = False
[WATER PROD AFTER THE INCIDENT].Locked = False
[SEQUENCE OF EVENTS].Locked = False
[STATUS NORMALIZED].Locked = False
[STATUS BEING NORMALIZED].Locked = False
[STATUS UNDER SHUTDOWN].Locked = False
[OTHERS 2].Locked = False
[NAME ORIGINATOR].Locked = False
[DATE PREPARED].Locked = False
Command76.Enabled = True
' all field list you want to locked
End Sub
Private Sub Command605_Click()
On Error GoTo Err_Command605_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmHelpDeskTickets"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Private Sub Command76_Click()
On Error GoTo Err_Command76_Click
DoCmd.GoToRecord , , acNewRec
Dim vLastY As Variant
Dim iNext As Integer
vLastY = DMax("[INCIDENTREPORTSEQNO]", "[INCIDENT REPORT]", "[INCIDENTREPORTSEQNO] LIKE '" & Format(DATE, "yy\*\'"))
If IsNull(vLastY) Then
iNext = 1
Else
iNext = Val(Mid(vLastY, 7, 4)) + 1
End If
Me![INCIDENTREPORTSEQNO] = Format(DATE, "yy-mm") & "-" & Format(iNext, "000")
Exit_Command76_Click:
Exit Sub
Err_Command76_Click:
MsgBox Err.Description
Resume Exit_Command76_Click
End Sub
Private Sub Command79_Click()
On Error GoTo Err_Command79_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Command79_Click:
Exit Sub
Err_Command79_Click:
MsgBox Err.Description
Resume Exit_Command79_Click
End Sub
Private Sub Combo80_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[INCIDENTREPORTSEQNO] = '" & Me![Combo80] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Print_Incident_Main_Report_Click()
On Error GoTo Err_Print_Incident_Main_Report_Click
Dim stDocName As String
stDocName = "IncidentMainReport"
DoCmd.OpenReport stDocName, acNormal
Exit_Print_Incident_Main_Report_Click:
Exit Sub
Err_Print_Incident_Main_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Incident_Main_Report_Click
End Sub
Private Sub Command95_Click()
On Error GoTo Err_Command95_Click
Dim stDocName As String
stDocName = "MaintenanceReport"
DoCmd.OpenReport stDocName, acNormal
Exit_Command95_Click:
Exit Sub
Err_Command95_Click:
MsgBox Err.Description
Resume Exit_Command95_Click
End Sub
Private Sub Command97_Click()
On Error GoTo Err_Command97_Click
Dim stDocName As String
stDocName = "OperationReport"
DoCmd.OpenReport stDocName, acNormal
Exit_Command97_Click:
Exit Sub
Err_Command97_Click:
MsgBox Err.Description
Resume Exit_Command97_Click
End Sub
Private Sub Command99_Click()
On Error GoTo Err_Command99_Click
Dim stDocName As String
stDocName = "IncidentMainReport"
DoCmd.OpenReport stDocName, acPreview
Exit_Command99_Click:
Exit Sub
Err_Command99_Click:
MsgBox Err.Description
Resume Exit_Command99_Click
End Sub
Private Sub Command100_Click()
On Error GoTo Err_Command100_Click
Dim stDocName As String
stDocName = "IncidentMainReport"
DoCmd.OpenReport stDocName, acPreview
Exit_Command100_Click:
Exit Sub
Err_Command100_Click:
MsgBox Err.Description
Resume Exit_Command100_Click
End Sub
Private Sub SCE_Click()
End Sub
Private Sub TabCtl245_Change()
Dim strInput As String
Dim ctl As Control
If TabCtl245.Value = 0 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 1 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 2 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 3 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 4 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 5 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 6 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 7 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 8 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 9 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 10 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 11 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 12 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 13 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
If TabCtl245.Value = 14 Then
strInput = InputBox(" Please Enter Password ", _
" Restricted area ")
If strInput = "" Or strInput = Empty Then
MsgBox " Please Enter Password ", , "Required Data"
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
If strInput = "123" Then
Else
MsgBox (" You are not athorized ")
TabCtl245.Pages.Item(0).SetFocus
Exit Sub
End If
End If
End Sub
Private Sub Text239_AfterUpdate()
INCIDENTREPORTSEQNO.SetFocus
DoCmd.FindRecord Text239.Value
Text239.Value = ""
Text239.SetFocus
End Sub
Private Sub Command244_Click()
On Error GoTo Err_Command244_Click
DoCmd.RunCommand acCmdUndo
DoCmd.GoToRecord , , acLast
Exit_Command244_Click:
Exit Sub
Err_Command244_Click:
'MsgBox Err.Description
Resume Exit_Command244_Click
End Sub
Private Sub Command253_Click()
On Error GoTo Err_Command253_Click
DoCmd.GoToRecord , , acFirst
Exit_Command253_Click:
Exit Sub
Err_Command253_Click:
MsgBox Err.Description
Resume Exit_Command253_Click
End Sub
Private Sub Command254_Click()
On Error GoTo Err_Command254_Click
DoCmd.GoToRecord , , acPrevious
Exit_Command254_Click:
Exit Sub
Err_Command254_Click:
DoCmd.GoToRecord , , acFirst
'MsgBox Err.Description
Resume Exit_Command254_Click
End Sub
Private Sub Command255_Click()
On Error GoTo Err_Command255_Click
DoCmd.GoToRecord , , acNext
Exit_Command255_Click:
Exit Sub
Err_Command255_Click:
DoCmd.GoToRecord , , acLast
'MsgBox Err.Description
Resume Exit_Command255_Click
End Sub
Private Sub Command256_Click()
On Error GoTo Err_Command256_Click
DoCmd.GoToRecord , , acLast
Exit_Command256_Click:
Exit Sub
Err_Command256_Click:
MsgBox Err.Description
Resume Exit_Command256_Click
End Sub
Private Sub Command286_Click()
On Error GoTo Err_Command286_Click
Dim stDocName As String
stDocName = "E-mail Tracking"
DoCmd.RunMacro stDocName