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

    Talking Default value from another form

    I have a user and pass form which leads to a different form...



    Is it possible so that one of the fields from the second form takes the value from the user and pass form...

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    In the control source for the control on the 2nd form, put:

    =Forms!MyFirstForm!MyFirstFormControl

    ... where MyFirstForm is the name of your first form, and MyFirstFormControl is the name of the control on the first form who's value you want on the second form.

  3. #3
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    Still not getting the reply from the user form

  4. #4
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    I think I will need more info before I can help you. What do you mean by "the reply"? Can you provide more explicit information about what is happening, and what you want to have happen?

  5. #5
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    I meant that the Original Form is not taking the username that of from the User and Pass form.... :'(

  6. #6
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Is the user and pass form still open? If it is closed, then you may need to save the username and password in global variables. Then you can have a simple function which returns the user and pass. let me know if you need examples.

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

    now how can we do it

  8. #8
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    Sorry for delay was out and away so could not reply for so many days

  9. #9
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Create a new module. Enter this:

    public gstrUserName as string
    public gstrPassword as string

    public function GetUserName() as string
    GetUserName = gstrUserName
    end function

    public function GetPassword() as string
    GetPassword = gstrPassword
    end function


    ... now in your "enter username and password form" in your OK button OnClick event procedure put

    gstrUserName = Me!MyUserNameControl
    gstrPassword = Me!MyPasswordControl

    You can use the GetUserName function to return the user name in a control on another form using this control source:

    =GetUserName()

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

    The object you are referring to is closed or does not exist :|

  11. #11
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    Done I edited a little and it worked

  12. #12
    hitesh_asrani_j is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    75
    No still not working....
    The field is highlighted with the correct user name... but the table is updated with out the User/Agent name empty in it...
    please help
    please

  13. #13
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Now you want to update a table? Is this a separate question?

    Try binding your form to the table. If you need more information on this, please create a new topic post.

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

Similar Threads

  1. Default Form Size
    By plevine1 in forum Forms
    Replies: 2
    Last Post: 09-24-2011, 07:14 PM
  2. Default form layout when creating new form
    By MDB in forum Programming
    Replies: 1
    Last Post: 08-30-2011, 08:17 AM
  3. Default Values in a form
    By handjor in forum Forms
    Replies: 3
    Last Post: 08-03-2011, 09:11 AM
  4. How to set default form
    By LAazsx in forum Forms
    Replies: 4
    Last Post: 11-28-2010, 12:22 AM
  5. update default value in form
    By leah7au in forum Access
    Replies: 3
    Last Post: 05-14-2009, 07:11 AM

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