Results 1 to 11 of 11
  1. #1
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75

    Form as a pop up

    Hi,


    How to get a form as a pop up.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Change the form's POPUP property to YES when the form is in design view.

  3. #3
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75

    Thumbs up

    GR8 thanks, u r the best.

  4. #4
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    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"

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    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.

  6. #6
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    I actually have a ELSE filed for the return of null values...


    Help me understand why we used Chr(34) here?

  7. #7
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    Thanks

    I found out that Chr(34) resembles to "



    thanks a lot for your help
    i will check if this works

    Still thanks

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by hitesh_asrani_j View Post
    I actually have a ELSE filed for the return of null values...
    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.

    Help me understand why we used Chr(34) here?
    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:

    "[FieldName] = """ & Me.ControlNameHere & """

    But it is personal preference.

  9. #9
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    Gr8 The Chr(34) worked you are awesome...

    One last question if you have a problem

  10. #10
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    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

  11. #11
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by hitesh_asrani_j View Post
    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.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums