Results 1 to 11 of 11

Thread: Text boxes with an if, driving me crazy

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    56

    Text boxes with an if, driving me crazy

    Ok, I have a form is a a user name text box and password text box. Here is the code that I am trying.

    public xlogin as varient
    public xpassword as varient

    If login.value = null then
    msgbox " Enter a user name"
    end if

    If password.value = null then
    msgbox "Enter a password"
    end if

    if login.value and password.value = not null then
    xlogin = login
    xpassword = password

    docmd.close acform, "frm_login"
    end if

    Ok, so none of it works heh, I get a data type mismatch on the 3rd if and if I remove the 3rd if I dont get any msgboxes if I leave the User and Passworld blank. If I change the .value to .text I get an error message that I can't reference a property or method for a control unless that control has the focus. I tried a could other things but they were just shots in the dark. Thank you for any help that you can offer!

    Hizaed
    Last edited by Hizaed; Jul 15th, 2005 at 04:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width