Results 1 to 6 of 6

Thread: Clearing Form

  1. #1
    Join Date
    Jul 2004
    Posts
    7

    Unanswered: Clearing Form

    When I click the Close button on a form, I have the Login form pop up.

    How do I clear the fields in the Login when it pops up.

    After the form "logs" the user in, it is set to Visible = False. Then the next form pops up.

    I've tried using Form_Open, Form_Activate, Form_GotFocus but none seem to work.

    Any suggestions?

    Thanks,
    Steve

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    why do you want the login form pop up on closing? I don't quite understand what your question is. Try explaining your environment with more details

  3. #3
    Join Date
    Jun 2004
    Posts
    55
    o.o So you want to set the fields in the form to null? On the on open event put in:

    [FieldName] = Null

    As Khan said I'm not to sure why you'd need to do this, but hey.

  4. #4
    Join Date
    Jul 2004
    Posts
    7
    When the user closes the form they essentially log out of the system. When the login form pops up, the previous username and password are still showing in the textboxes. I want the fields cleared so someone can't just click Enter and log back in.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Red face

    Quote Originally Posted by scain2004
    When the user closes the form they essentially log out of the system. When the login form pops up, the previous username and password are still showing in the textboxes. I want the fields cleared so someone can't just click Enter and log back in.
    I like the others am not quite understanding. When the user on the system Closes a certain form it logs them out of the entire program at that point in time? hmmmmm, interesting. Well, seems if that happens you don't need the LogIn form to open again UNTIL another user comes and opens the program up all over again. You should set your Login form to open only when the database Opens, somewhere in the OnLoad event or somewhere. Still though not sure why it is maintaining the info. from the previous login. Does the user also have to supply a password? If so that should take care of the unintentional logging in, unless that field is also either still populated or you don't have a Mask over it.

    Bud

  6. #6
    Join Date
    Dec 2003
    Posts
    268

    Form

    I am assuming that that form is set up a modal and all of the following forms reference the information on the form for access rights etc. In my opinion this is a TERRIBLE way to try and control user access via code rather than the MDW file associated with Access.

    Anyhoo back to your question.

    on the activate action for the form:

    dim ctl as control
    for each ctl in controls
    if ctl.controltype = actextbox then
    ctl.value = ""
    next ctl

    this will cycle through each ctl on the form if it is a text box, clear the values.

    The more critical issue is to try and come up with better methodology for controlling user access. i.e. some ideas....
    create a user object and store the information that wont have to be accessed from form.
    Create global variables and store the information there and have the forms reference these variables
    Implement Access PW protection

Posting Permissions

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