Results 1 to 5 of 5
  1. #1
    lqangel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2015
    Posts
    6

    Connections between forms and tables

    Hi Everyone,

    I'm going to do my best to explain my situation. What I may be requesting might not be possible exactly, and if not, that's okay.

    First off, here is the basic set up:
    Form A
    Form B
    Table 1
    Table 2
    Field: Link

    I have Form A that has text boxes with sources from Table 1. One of those sources is called Link. The Link field is a text box that you can enter a hyperlink in, and when you click on it your browser opens and takes you to the webpage entered.



    This is all fine and works great, now what we WANT to do is have a button, or even just the same text box pulling into Form B from Form A.

    The issue: Form B has text boxes with sources from Table 2.

    Is there some way to create a Macro, or code, or button of some kind that when selected/clicked in Form B with locate the correct record and open the website entered in the text box in Form A?



    We want to have them connected, in a way that we only have to edit in one place if there are changes. There are matching fields I can use in both to compare and make sure I am finding a matching record.
    Form A lists companies, and Form B lists employees of the companies. To give you an idea of what I'm working with.



    Thank you in advance for any help you can provide,
    Ashley

  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
    You can certainly use DLookup() or a recordset to find the link field in one table presuming the key value is available. If you use a button, you can use FollowHyperlink and the result of either.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    lqangel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2015
    Posts
    6
    I believe FollowHyperlink would only allow me to use one link, and it varies per record. Can you explain how to create the DLookup() formula? That sounds promising.

    Sample Data:
    Client: TomorrowLand Inc.
    Contact: JM
    Link: www.testing.com

    I would need to match TWO sets of criteria, Client and Contact.

    Would it read something like this?: DLookup(If [FormA]![Client]=[FormB]![Client] AND [FormA]![Contact]=[FormB]![Contact], [FormA]![Link],)

  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
    Here's more on DLookup() syntax:

    DLookup Usage Samples

    FollowHyperlink can use a variable address, so it could use the result of the DLookup()
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You shouldn't need to use Dlookup() if your table structure is correct.
    Form A lists companies, and Form B lists employees of the companies.
    So that should mean that Table1 has the companies and Table2 has the employees.
    1 company can have many employees and
    1 employee works at 1 company.

    There is a 1 to many relationship between companies and employees.

    FormA displays companies so a little code can open the web page link.

    FormB displays employees. FormB should have a query as the record source that joins companies and employees. So a little code can open the web page link.

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

Similar Threads

  1. Problems with Database connections
    By Goinfory in forum Misc
    Replies: 1
    Last Post: 06-22-2015, 06:13 AM
  2. DSN-less connections, how?
    By tpcolson in forum Access
    Replies: 6
    Last Post: 02-17-2014, 07:53 PM
  3. How many FE connections to BE are too many?
    By ItsMe in forum Database Design
    Replies: 3
    Last Post: 12-06-2013, 04:07 PM
  4. creating connections between forms
    By premis in forum Access
    Replies: 6
    Last Post: 03-29-2013, 01:21 PM
  5. Replies: 10
    Last Post: 07-12-2011, 11:09 PM

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