Results 1 to 5 of 5
  1. #1
    DaveTief is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Location
    SaddleBrooke, AZ
    Posts
    1

    Link Table to Form

    I have developed a Microsoft Database Access 2010 Table and associated Form

    I open both the Table and Form and a separate tab appears for each, then I can switch from either the table or form by clicking the tab.



    In the Table screen I select a record, as an example, record number 1926.

    How can I link this record with the form so that when I select the form tab, record 1926 is shown?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    I don't think you can and I can't imagine why you would want to. Tables are only for storing data.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I agree with Bob -- your question seems to need more context. Why do you want this?

    A table is where the data is stored. A form is typically used to provide the user a controlled way to see/add/change data.
    With a form the developer can add code to validate an entry, can substitute codes for names etc.. so the user of the form can not simply access and change/delete entries randomly with nobody aware such changes were made. The form with designed code can actually prevent/guide the user according to established "business" rules.

    Good luck with your project

  4. #4
    Geo21 is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2014
    Posts
    20

    Link Table to Form

    I agree with the 2 above. Though, if you must do this, try the "On Got Focus" Property of the form. Then, type the code:

    Code:
    Dim rs As Object
    
    If SysCmd(acSysCmdGetObjectState, acTable, "Table Name") <> 0 Then
        Set rs = Me.RecordsetClone
        rs.FindFirst "ID = " + [Tables]![Table Name]![ID]
        Me.Bookmark = rs.Bookmark
    End If
    Assuming ID is the unique value to distinguish your record.

    Also, the If...Then checks if the table is open.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Sounds like a Split form might serve your needs.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Form for new data entry which link to another table
    By marcvanderpeet12 in forum Forms
    Replies: 3
    Last Post: 06-12-2013, 09:47 PM
  2. Link Form to Table
    By earlyr in forum Forms
    Replies: 1
    Last Post: 05-13-2013, 07:31 PM
  3. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  4. Form loosing link to table
    By kcm4491 in forum Forms
    Replies: 9
    Last Post: 03-23-2011, 07:27 AM
  5. link excel form to access table
    By data123 in forum Import/Export Data
    Replies: 6
    Last Post: 06-23-2006, 10:17 AM

Tags for this Thread

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