Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Posts
    5

    Unanswered: Expression Issues

    Hey guys..
    New to the forum and pretty new to databases.

    I'm trying to create a login page (Form) that through the use of text boxes within the form; uses data stored in a table to open up a seperate form. The table is in place to store the Username and Password. The whole idea behind this is that hopefully the user will need to enter both the Username and it's corresponding Password in order to gain access to the home page. The Username and Password are entered into the table through a seperate method unrelated to what i'm trying to achieve here; so this is not an issue. Not too sure how I'd go about this and whether i would need to include Queries etc..

    Currently I've entered this expression into the source code of the text box that i'm intending on using to enter the Username:
    =IIf([Text1]=[Login]![Username],[OpenForm]![Forms]![Switchboard],[OpenForm]![Forms]![Switchboard])

    [Text1] is the text box that I am using to enter the Username into.
    [Login]![Username] is the Table and field, and; [OpenForm]![Switchboard] is the home page that I am attempting to open.

    However this isn't working and i'm not sure whether I'm doing it right at all.. So any tips on how to do it would be great thanks

    Also, I'm not familiar at all with working with SQL, so I'd rather avoid it. Thanks.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    a suggestion
    ditch writign your own userid/password and use the netwrok logon API call to retrieve the userid. then use that userid within your own security schema or modified the workgroup security in Access.

    why
    its no longer a maintenance task for you to change users passwords, your users no longer have to remember yet another <expletive deleted> userid + password combo. your app is no longer exposed to password vulnerabilities, if theres an issue i he network password that is dodgy.. so thats the network trolls problem not yours.

    if you want to use the API call google Dev Asish ApI call or look at the code bank for stuff that PKStormy has developed based on those calls.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    This ^^^^

  4. #4
    Join Date
    Apr 2010
    Posts
    5
    Thanks for your suggestion.
    This is actually for assignment purposes.. So I don't think it will work.

  5. #5
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    First off, I'd advise getting into the habit of naming your controls to something meaningful, so that your code is easier to read when you revisit it in a month's time.

    Secondly, both the true and false sections of your IIF statement have the same result, and they're both trying to carry out an action, rather than return a value.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if its for assignment purposes, I'd still go with the network API call and brief paragraph as to why writing own code which needs through testing is a bad idea when their is fucntionality that already exists to do this job. its a win win situation.
    you still need to write the code to check what a user/usergroup has permissions for
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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