apprentice
Registered User.
- Local time
- Today, 12:23
- Joined
- Jan 13, 2015
- Messages
- 27
I have a form that are filled by end users and the supervisor verifies the data by ticking a "Completed" checkbox then click on a command button (Post) to post the data into another table.
However, i would like the Post button to be disable after each record is posted and remains disabled. My codes does not allow my Post button to remain disabled. Whenever the form is reopened the button is enabled automatically.
I will greatly appreciate if anyone can assist me.
Codes used;
Private Sub Command297_Click()
On Error GoTo err_handler
If Me.chkCompleted Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings (False)
DoCmd.OpenQuery "InspecUpdate", acViewNormal
Me.Requery
DoCmd.SetWarnings (True)
MsgBox "Post Successful!"
Me.Command297.Enabled = False
Else
Me.Command297.Enabled = True
MsgBox "You cannot transfer this record until "Completed is checked"
End If
Exit Sub
err_handler:
DoCmd.SetWarnings (True)
MsgBox Err.Description, vbExclamation, "Error Number: " & Err.Number
Exit Sub
End Sub
However, i would like the Post button to be disable after each record is posted and remains disabled. My codes does not allow my Post button to remain disabled. Whenever the form is reopened the button is enabled automatically.
I will greatly appreciate if anyone can assist me.
Codes used;
Private Sub Command297_Click()
On Error GoTo err_handler
If Me.chkCompleted Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings (False)
DoCmd.OpenQuery "InspecUpdate", acViewNormal
Me.Requery
DoCmd.SetWarnings (True)
MsgBox "Post Successful!"
Me.Command297.Enabled = False
Else
Me.Command297.Enabled = True
MsgBox "You cannot transfer this record until "Completed is checked"
End If
Exit Sub
err_handler:
DoCmd.SetWarnings (True)
MsgBox Err.Description, vbExclamation, "Error Number: " & Err.Number
Exit Sub
End Sub