I have a password table with the fields
PasswordID AutoNum
InsId Text
Name Text
I'm using this code to password protect a field
Private Sub Detail_Click()
Dim strpword As String
Dim iResponse As Integer
strpword = InputBox("Enter password")
If strpword = DLookup("[Password]![InsId]", "[Password]") Then
Me.cboDate.Enabled = True
Exit Sub
Else
iResponse = MsgBox("Not Authorizes for Updates!", vbOK)
End If
End Sub
The code works fine for the first record but does not find records after the first. I'm new to VB but I believe I need a criteria or a loop. Can some one please help. Thanks
PasswordID AutoNum
InsId Text
Name Text
I'm using this code to password protect a field
Private Sub Detail_Click()
Dim strpword As String
Dim iResponse As Integer
strpword = InputBox("Enter password")
If strpword = DLookup("[Password]![InsId]", "[Password]") Then
Me.cboDate.Enabled = True
Exit Sub
Else
iResponse = MsgBox("Not Authorizes for Updates!", vbOK)
End If
End Sub
The code works fine for the first record but does not find records after the first. I'm new to VB but I believe I need a criteria or a loop. Can some one please help. Thanks