Hi,
How to get a form as a pop up.
Hi,
How to get a form as a pop up.
Change the form's POPUP property to YES when the form is in design view.
GR8 thanks,u r the best.
![]()
Can you help me solve this
"I have a table which has three columns ID, Employee and Password (with the same name)
I have form with two texts and one button.
Text one is user name (named EMP)
Text 2 is password (name PASS)
The table is tblEmployees
I used the code builed and inserted the following code for checking for the user and pass..
"
If Me.PASS.Value = DLookup("Password", "tblEmployees", "[Employee]=" & Me.EMP.Value) Then
DoCmd.Close acForm, "UserPassForm", acSaveNo
DoCmd.OpenForm "Data"
End If"
But the code is returning the error as
"The expression you entered as a query parameter produced this error : "Hitesh" (one of the usernames i inputed)
help me....!!!! PLEASE"
as in the Thread "User and Pass Form"
If Employee is text, it should be:
Nz(DLookup("Password", "tblEmployees", "[Employee]=" & Chr(34) & Me.EMP.Value & Chr(34)), vbNullString)
Which adds quotes around the text value and the NZ function helps if it returns a null because it can't find a match.
I actually have a ELSE filed for the return of null values...
Help me understand why we used Chr(34) here?![]()
Thanks
I found out that Chr(34) resembles to "
thanks a lot for your help
i will check if this works
Still thanks![]()
The Else isn't going to help. If you have a DLookup and it returns a null, you will get an "INVALID USE OF NULL" error message. You need to use the NZ function with the DLookup in case a null does get returned. The Else would be too late.
Chr(34) is a double quote ("). When you have a text field you have to surround the control's, or variable's, value with quotes. You can use Single Quotes (') which I tend to not use because a lot of times if you run into some data with a single quote like Bob's then it is going to fail. You can use triple double quotes (""") instead of the Chr(34) but I find that the Chr(34) is much easier to read and understand what is there than trying to decipher a bunch of quotes:Help me understand why we used Chr(34) here?![]()
"[FieldName] = """ & Me.ControlNameHere & """
But it is personal preference.
Gr8 The Chr(34) worked you are awesome...
One last question if you have a problem![]()
![]()
BOB.... The Userform has a drop down for username and wen a person is selecting on of the drop downs the password comes by itself
![]()
That sounds like you either are assigning it to the control or you have it in the combo's row source and are referring to it in a way which shows it in the text box. Hard to say without seeing it.