linking form to record

Discussion in 'Microsoft Access' started by John, Apr 28, 2005.

  1. John

    John Guest

    I have 1 table: tbl_main
    primary key is a field called JobNo

    1 query: qry_main (this simply has all fields and just places the JobNo
    field in ascending order).

    I have 2 forms
    frm_main
    frm_bldInfo

    I have created the main form where by the user simply presses a macro button
    to open up the frm_bldInfo.
    But when the frm_bldInfo opens, it does not open with the relevant
    information for the record selected in the main form. The frm_bldInfo simply
    shows the first record info in the database and not the relevant record
    chosen initially in the main form.
    Both the forms have their source as the qry_main.

    Should I create a second table that has the bldinfo on its own then simply
    create a query linking the two tables with the JobNo field ?
    thanks for any help.
     
    John, Apr 28, 2005
    #1
    1. Advertisements

  2. John

    Joan Wild Guest

    John wrote:
    > I have created the main form where by the user simply presses a macro
    > button to open up the frm_bldInfo.


    If you are using a macro, edit the macro Open Form action. In the lower
    pane in the Where cell put
    [JobNo]=[Forms]![frm_main]![JobNo]

    If you were using event procedure you would modify the code to include the
    where clause

    DoCmd.OpenForm "frm_bldInfo", , , [JobNo]=" & Me![JobNo]

    --
    Joan Wild
    Microsoft Access MVP
     
    Joan Wild, Apr 28, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cheng-Liang Shen
    Replies:
    1
    Views:
    368
  2. karenk10
    Replies:
    0
    Views:
    182
    karenk10
    Sep 22, 2004
  3. Guest
    Replies:
    13
    Views:
    1,338
    Guest
    Mar 7, 2006
  4. Guest
    Replies:
    1
    Views:
    160
    Steve Schapel
    Nov 18, 2006
  5. spreadsheetlady
    Replies:
    1
    Views:
    958
    Jeff Boyce
    Jan 26, 2010
Loading...

Share This Page