Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    2

    Unanswered: Please Help: Open form3 using form1 connected via form2

    I would greatly appreciate if someone can provide sample code or any direction regarding this.

    There are three forms: form1, form2, & form3
    I want to open form3 using form1 connect via form2.

    Here is table Orientation:
    Table1:form1 field: ID1
    Table2:form2 field: ID2 ID1
    Table3:form3 field: ID2

    The form1 can be related to form2 by Forms!form2![ID1] = Forms!form1![ID1]
    The form2 can be related to form3 by Forms!form3![ID2] = Forms!form2![ID2]

    Somehow, when form1 is related form2, I need to get ID2 that corresponds to ID1.

    So, when command button on form1 is clicked it will open up form3 via form2 using ID2. I need some direction on this.

    Thank you,

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    docmd.openform "MyFormX",,"[SomeID] = " & Forms!MyOtherForm!SomeID & ""

    Research the WHERE parameter when opening forms. If you need additional help, look at some of the examples in the code bank. There are plenty that do this.

    Otherwise, you need to look at the recordsource for your forms and determine which is the best route to go as far as criteria within your recordsets for the forms.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Nov 2009
    Posts
    2
    Here is the problem with better explanation.....
    I have three forms and three tables
    Forms Names are:-
    1) frmCommand
    2) frmProductRevision
    3) frmProduct

    Field name for each Tables are:-
    1) tblCommand
    Field Name: C_UniqueID ----- C_Name ----- PR_UniqueID

    2) tblProductRevision
    Field Name: PR_UniqueID ----- P_UniqueID ----- PR_RevisionName

    3) tblProduct:
    Field Name: P_UniqueID ----- P_Name

    There are two buttons in frmCommand:-
    1) Open Product Revision
    2) Open Product

    There is one button in frmProductRevision:-
    1) Open Product

    In order to open frmProduct from frmCommand using a button, following two path can be used ?
    a) frmCommand -> frmProductRevision -> frmProduct
    --> Here, frmCommand has Button "Open Product Revision" which opens frmProductRevision filtered to that command, and frmProductRevision has button "Open Product" which open frmProduct filtered to that Revision.....

    b) frmCommand -> frmProduct
    --> HERS IS THE PROBLEM..... I want to open frmProduct by clicking on button "Open Product" on frmCommand directly, which will first filter Revision for that command and then filter Product for that Revision....
    Instead of using path a) which opens frmProductRevision inorder to open frmProduct, I want to do all the filtering in frmCommand without opening frmProductRevision.... so that "Open Product" button on frmCommand can directly open frmProduct filtered for that particular command.....

    Is there is way to open "frmProduct" from "frmCommand" by clicking Open Product button on "frmCommand" directly ???

    Thank you
    Attached Files Attached Files
    Last edited by User1235; 12-01-09 at 12:10.

Posting Permissions

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