Results 1 to 2 of 2
  1. #1
    boydwspoon is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    1

    Linking two forms

    I am new to access. I am building a database with 4-5 forms. The first form is just a list records (names). The second forms has data about the record (name address etc), the third form has additional data (medical history) and the fourth form is related and requires results information to be entered.

    I would like to be able to open the database and all 4 forms open, I want to be able to click on the record name on form 1 and have it take me to form 2, with form 2 having the data that belongs to that record. At the same time forms 3 and 4 should populate with the data related to that record.

    On form 2, I have added the previous and next buttons and can advance to the next record. I need form 3 and 4 to advance with it. Also, when form 4 is marked completed, I want the record to be marked complete and have this staus show up on form 1.

    I did not use subforms and am wondering if I should have.

    Thanks


    Chris

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    The short answer is Yes. Based on your statement it looks like form 2, 3 and 4 are all dependent on the current record of form 1 so they definetly should be subforms. My question is you state that when form 4 is marked complete the record should be marked complete and the status should show on form 1. So is the field on form 1 the same field as Form 4. If it is then a simple requery for form 1 when the status on form 4 is updated. However if they are 2 separate fields in different tables you will have to run an update query on the form 1 table and then requery form 1 when form 4 is updated.

    for example The Form 4 Status Complete field is a yes/no field (well call it status) That uses a radio button control and is the same field as form 1

    Code:
    Private sub status_click()
         Form1.requery
    End Sub
    This example is if Form 4 and Form 1 use 2 different status fields

    Code:
    Private sub status_click()
        Dim strsql as string, adocmd as adodb.command
        strsql = "Update form1table set Status = " & status Where form1.data = " & me.data  'where me.data and form1.data are the fields linking the 2 forms
        adodb.connection = currentproject.connection
        adodb.commandtext = strsql
        adodb.execute

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

Similar Threads

  1. linking forms
    By chiefmsb in forum Access
    Replies: 10
    Last Post: 07-08-2011, 03:57 PM
  2. Linking two forms
    By JeffG3209 in forum Forms
    Replies: 3
    Last Post: 05-09-2011, 12:26 PM
  3. Linking forms
    By warrigal in forum Database Design
    Replies: 2
    Last Post: 04-07-2011, 05:12 PM
  4. Linking Forms
    By glasgowlad1999 in forum Forms
    Replies: 1
    Last Post: 02-02-2011, 09:35 AM
  5. Linking two forms together
    By Lxmanager in forum Access
    Replies: 8
    Last Post: 09-27-2010, 05:10 PM

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