Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Method or data member not found on database field

Status
Not open for further replies.

Sillygirl

Programmer
May 3, 2002
80
US
The following code is blowing up on the Myset.Master_Flag sentence - VBA is actually highlighting the Master_Flag which is a field in the recordset it is referring to. I'm using DAO 3.6 in the reference field. How do I fix it?

Dim MyDB As DAO.Database, Myset As DAO.Recordset
Dim Response As Integer
Dim criteria As String

Set MyDB = DBEngine.Workspaces(0).Databases(0)

Set Myset = MyDB.OpenRecordset("tblPassword", dbOpenDynaset)

criteria = "Password = '" & UCase(Forms![fmnuMainMenu]![txtPassword]) & "'"

' Verify that the password is on file and also that the user to authorized
' to change passwords

Myset.FindFirst criteria
If Myset.NoMatch Then
MsgBox "Invalid Password, Please try again!"
Forms![fmnuMainMenu].txtPassword = ""
Forms![fmnuMainMenu].txtPassword.SetFocus
Else
If Myset.Master_Flag = "Y" Then
Forms![fmnuMainMenu].txtPassword = ""
DoCmd.OpenForm "frmPasswordMaintenance"
Else
MsgBox "You are not authorized to change Passwords!"
Forms![fmnuMainMenu].txtPassword = ""
' Forms![fmnuMainMenu].ClickCase.SetFocus
End If

End If

End Sub

Thanks,
Sillygal [ponytails]
 
And this ?
If Myset[!]![/!]Master_Flag = "Y" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top