• Open Form button doesn’t link two tables (Access 2K, SR-1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Open Form button doesn’t link two tables (Access 2K, SR-1)

    Author
    Topic
    #364139

    I have a form called frmContactInfo and when I pull up a specific record, then click on “Camper” button which brings up another form called frmCmpPermInfo, it refuses to insert the ContactID from frmContactInfo into table that is attached to frmCmpPermInfo.

    I had used the Toolbar Wizard to create a button that opens another form. How can I modify the event so that it would insert the contactID from the initial form into the secondary table?

    Viewing 0 reply threads
    Author
    Replies
    • #558094

      I assume that the frmCmpPermInfo is being opened to a new record and you want to set the frmCmpInfo’s ContactID to the same ID as on frmContactID. Search Help for OpenArgs and there you will find a good example of how to pass your ContactID to the new record.

      hth,
      Jack

      • #558096

        I’ve tried OpenArgs but the ContactID column in the table is still blank.

        I’ve also tried: =[Forms]![frmContactInfo]![ContactID] in an unbound field attached to the frmCmpInfo with same results.

        I’m using a linked table (tblContacts). Will this cause problems?

        • #558100

          Do you have code similar to this in the second forms On Open event?

          If Not IsNull(Me.OpenArgs) Then
          Me.ContactID = Me.OpenArgs
          End if

          Jack

          • #558129

            Ahhh! I have got it licked. I found a form similiar to what I needed in a book I had. From its example, here was what I did:

            Create a field called contactsID, the Record Source is set to ContactsID in the table and then type this expression in Default Value field: =[Forms]![FrmContactInfo]![ContactID]

            How I didn’t think of it is beyond me. shrug

            • #558132

              The important things is that you have it sorted and it is working….

    Viewing 0 reply threads
    Reply To: Reply #558096 in Open Form button doesn’t link two tables (Access 2K, SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel