I've got an employee ID field that is formatted as text in the table. The ID is 7 numbers. I have a command button on the form that will not run unless the ID and a "password" are matched. Nothing is bound.
If DLookup("password", "tblEntry", "EmployeeID = " & Forms!frmDateSelector.Text5 & "")...
I've got 2003 and the Format of the textbox does not include text as an option. The problem is that I am having to enter an ID number (digits only) to match a table that has that number formatted as text. I get a data mismatch error when I try to run a query/VBA. Any suggestions?
Got a big fat Data mismatch error.
Also it doesn't like the line.
DoCmd.OpenReport rptTotal1047221, acViewPreview,,,acWindowNormal
wants to debug, but when I follow the instructions for the line it STILL doesn't like it.
This doesn't work either....still trying.
Private Sub Command4_Click()
If DLookup("password", "tblEntry", "password = 'Ruby' or password = 'Disney' or password = 'Metal'") = Forms!frmDateSelector!Text7 Then
RunMacro mcrpassword
Else
MsgBox "Wrong password"
End If
End Sub
This is what I have and it doesn't run the report when the password is correct. When it is wrong, the error does pop up so I'm halfway there!
If DLookup("password", "tblEntry", "password = 'Ruby' or password = 'Wish'") = Forms!frmDateSelector!Text7 Then
'DoCmd.OpenReport rptTotal1047221...
I added the DLookup to the Where Condition of the OpenReport on the macro. It ran, however, I can write ANYTHING in the "password" box in my form and it still runs. It's not comparing the input to the table. I feel like I'm close, but where/how do I write some sort of IF statement. A link in one...
I tried to put it in the Condition for the Macro and I got the following error:
The expression you entered as a query parameter produced this error: 'The object doesn't contain the Automation object 'Criteria."
Where do I put the code? in the macro as a condition? Query? attach it to the button on my form?
DLookup("EmployeeID","tblEntry","Criteria = 'Ruby' or 'Wish'")
Does this look alright?
How/where do you compare?
I have a form that has Start Date, End date, Employee ID and a "password". I have a table that has each ID and "password". How can I get the macro to run IF and only IF the Employee ID and "password" entered are correct (and not just both ON the table, but as a pair). I would prefer the simplest...
I have multiple queries, one for each auditor. Is is possible to password protect each query so that each auditor could only view their own query? I will have to hide the thingy (yup, I have no idea of the technical name or I would have used it.) and have them use a switchboard and macros to run...
I have a make table query whose destination is another database. It was working until I was asked to put a password on the destination database. I adjusted the make table query to include the password. (It actually asked for it the first time I went into the setup.) Now when I try to run the...