Checking the value of a field in a table from Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ColinWard

    Checking the value of a field in a table from Code

    Hi. I know there is a simple answer to this one but for the life of me I
    can't get it.

    I have a login form where users type their username and password. When
    they press the login button, I have a rout ine to validate the input
    which checks a table using DLookup. The table consists of three fields:
    UserName,Passwo rd and Administrator.

    Administrator is a yes/No field.

    I can add users and make them an administrator by using my Add User form
    which has an option group to select whether the user is an administrator
    or not. This all works fine. I can add users and select their
    administrator and it gets written correctly to the table.

    The problem I am having is extracting the value of the Administrator
    field in the tblLogin table and passing it to the main table so that I
    can enable/disable certain options.

    Hope this is clearer to most people than it is to me.

    Thanks for any help

    Colin




    *** Sent via Developersdex http://www.developersdex.com ***
  • jv

    #2
    Re: Checking the value of a field in a table from Code

    You could do another dlookup like:
    blnAdministrato r=dlookup("Admi nistrator","tbl Login","UserNam e='" &
    txtUserName & "'")

    blnAdministrato r could be a global variables if you need to use it in
    multiple places.

    I hope I understood your question correctly. Good luck.

    Julie Vazquez.

    Comment

    • ColinWard

      #3
      Re: Checking the value of a field in a table from Code


      Thanks Julie.

      It works Perfectly.!!!

      Colin


      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      Working...