Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Seattle, Washington, USA
    Posts
    179
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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?

  2. #2
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Form button doesn't link two tables (Access 2K, SR-1)

    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

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Seattle, Washington, USA
    Posts
    179
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Form button doesn't link two tables (Access 2K, SR-1)

    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?

  4. #4
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Form button doesn't link two tables (Access 2K, SR-1)

    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

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Seattle, Washington, USA
    Posts
    179
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Form button doesn't link two tables (Access 2K, SR-1)

    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. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  6. #6
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open Form button doesn't link two tables (Access 2K, SR-1)

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •