wedd
09-26-2011, 05:40 AM
Hi experts, I've created a comman button were I would like to edit records...the records or text fields are set are set to prevent a user from accidentally over writing existing data through a typo etc...I've locked the text fields; however, I would like the user to click on the command button to edit the data. I've enclosed code I've written below, but it doesn't seem to work...Can this be done? If so, how can this be done? Would you have an any examples of how this can be done?
Private Sub EditRecords_Click()
Dim cap As String
cap = Me.CmdEditRecords
Select Case cap
Case "Edit"
With Me
.AllowEdits = True
.CmdEdit.Caption = "Lock"
.CmdEdit.ForeColor = 128
.CmdEdit.FontBold = True
.Refresh
End With
Case "Lock"
With Me
.AllowEdits = True
.CmdEdit.Caption = "Edit"
.CmdEdit.ForeColor = 0
.CmdEdit.FontBold = False
.Refresh
End Sub
Thanks for your contributions :friends:
Private Sub EditRecords_Click()
Dim cap As String
cap = Me.CmdEditRecords
Select Case cap
Case "Edit"
With Me
.AllowEdits = True
.CmdEdit.Caption = "Lock"
.CmdEdit.ForeColor = 128
.CmdEdit.FontBold = True
.Refresh
End With
Case "Lock"
With Me
.AllowEdits = True
.CmdEdit.Caption = "Edit"
.CmdEdit.ForeColor = 0
.CmdEdit.FontBold = False
.Refresh
End Sub
Thanks for your contributions :friends: