On my main form (frmApplication) I have a delete records button. The onclick command is to open a popup form that prompts the user for a password before deleting the record. I have the correct password stored in tblpassword. I've taken a shot at the code for how to delete the record from the popup form but it's not working at all. I keep getting a compile error on the code below in red.
If you can take a look at this code and let me know what you think may work I'd appriciate the help. Thanks!
Private Sub cmbDelete_Click()
Dim StrPw As String
StrPw = tblpassword!password
If txtPassword = StrPw Then
DoCmd.RunCommand acCmdDeleteRecord Me.frmApplication
Else
MsgBox "Invalid Password"
End If
End Sub
If you can take a look at this code and let me know what you think may work I'd appriciate the help. Thanks!
Private Sub cmbDelete_Click()
Dim StrPw As String
StrPw = tblpassword!password
If txtPassword = StrPw Then
DoCmd.RunCommand acCmdDeleteRecord Me.frmApplication
Else
MsgBox "Invalid Password"
End If
End Sub