Results 1 to 9 of 9
  1. #1
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134

    vba Forms -- Opening a pop up form from a form to get values and update main form

    Hi



    I have two tables {tbl_Customer, tbl_Company} and I would like to know how to open another mini form (just to do a search '* keywords *') and once I find the string or text I need, I will just click on it (the value in the mini form) and the value on the main form is updated...

    The field "CompanyName" in the mini form is linked to the table "Company", which has all company names

    The table Customer contains following fields {CustID, FirstName, LastName, CompanyName, CompanyCity,...}

    the table Company contains the following fields {CompID, CompanyName, CompanyCity,...}

    Some "CompanyName" fields (from table Customer, are empty or misspelled, so by having a main form and a miniform, I can clean and correct those fields. I want to avoid copy and paste from the mini form.


    Regards

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This could be adapted:

    http://www.baldyweb.com/WrappedForm.htm

    adding a search textbox and a combo or list box.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    Thanks, but that is not what I am looking for.

    I don't know how to transport the value from the mini search form to the main form... to update it with the correct value from the table company.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The sample shows how, just imagine a combo or list box instead of the text box.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    thanks... I am thinking something more with me.OpenArgs, but I don't know how to send the value to the main form, once I selected the right name of the company from the mini form...

    ??
    Code:
    me.OpenArgs
    
    me.Recordsource
    ??

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You'd use OpenArgs to send a value to the popup. Have you looked at the sample? It gets the value from the popup back to the calling form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    I think I understand you! However, this is something else... I used the same logic with my various databases... DLookup(password, users, password = inputbox)...

    Thank you anyway...

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I guess I don't understand, as I don't see how DLookup() relates to this. I use this method to pop up a form with a list of drivers or vehicles that the user can pick from. It can be called from various places in the app, and passes back the selection to the form that called it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    I second Paul's suggestion of using the wrapper function with your "miniform".

    I use this method to do basically what you are wanting. I prefer to pass back the record ID. I also use it to make a custom InputBox() that uses the power of a form.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-22-2015, 07:24 PM
  2. Replies: 10
    Last Post: 09-22-2015, 08:06 PM
  3. Replies: 6
    Last Post: 07-16-2014, 12:18 PM
  4. Replies: 3
    Last Post: 09-20-2012, 11:23 AM
  5. Replies: 3
    Last Post: 06-02-2009, 09:51 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