Results 1 to 6 of 6
  1. #1
    PoorCadaver is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Oct 2011
    Posts
    68

    How to link two textboxes in different forms together?


    Hi!

    I have a form that recieves information from a table. In that form I have a button that opens another form, and in thet one I would like to use one of the values from the first form.
    I.e. Form1 have a textbox [ID1] that contains "1". In Form2 that opens from Form1, I would like the textbox [ID2] to use the value from [ID1], namely "1". How do I link them together?

    Thanks!

    /Jonas

  2. #2
    imintrouble is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Missouri, where frownin's a sport
    Posts
    127
    What is the second form based on? is it the same table the two are based on?

  3. #3
    PoorCadaver is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Oct 2011
    Posts
    68
    No it's another table, but the ID is the same in both tables. Form2 is an adding-form that will use the ID in Form1 to put in another table.
    One table contains a list of equipment and the other is a list of service reports.

  4. #4
    PoorCadaver is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Oct 2011
    Posts
    68
    Bumping =)

  5. #5
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    To Clarify:

    You have two tables:
    First for equipment (I shall now refer to this as [Tbl_Equipment], and assume the primary key is [PK_ID1])
    Second for service reports (I shall now refer to this as [Tbl_Service_reports] with a foreign key being [PK_ID1], named in the tabls as [ID2])

    You have two forms:
    First for equipment using [Tbl_Equipment] as its recordsource. I shall Call this [Frm_1]
    Second for service reports on the aforementioned equipment using [Tbl_Service_reports] as its recordsource. I shall call this [Frm_2]

    You have a command button, with either visual basic or a macro to open on [Frm_1] to open [Frm_2] in order to add a new record.

    You want the value in [PK_ID1] on [Frm_1] to be placed into a field [ID2] on [Frm_2] When [Frm_2] is opened.

    The solution:

    1. In [Frm_2] goto design view.
    2. Right click [ID2]
    3. Click Properties
    4. Click Data
    5. Click Default Value
    6. Change to read; =[Forms]![Frm_1]![PK_ID1]

    That *should* do it unless I have misunderstood.

  6. #6
    PoorCadaver is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Oct 2011
    Posts
    68
    Well, that was very helpful! But it only seems to work with ID that are digits. Those ID containing letter gets an #error.
    Also, when I try to save the new post it says: "You can't add or alter the post. A relatedpost in Tbl_Equipment is required."
    So what to do? I can't figure it out by myself =(

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

Similar Threads

  1. Replies: 12
    Last Post: 10-20-2014, 11:22 AM
  2. ID Link issues between Forms/Tables
    By fat ralphy in forum Access
    Replies: 4
    Last Post: 10-13-2011, 03:20 PM
  3. Link two forms to display related data
    By KrisDdb in forum Forms
    Replies: 3
    Last Post: 09-19-2011, 02:41 PM
  4. Link to Forms
    By Luke in forum Forms
    Replies: 1
    Last Post: 07-14-2011, 08:51 AM
  5. Link from access forms to Excel file
    By aligahk06 in forum Forms
    Replies: 1
    Last Post: 04-30-2010, 04:24 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