Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2011
    Posts
    1

    Unanswered: display two tables on a form with tabs

    Hi guys,

    I've read several threads about an issue that i'm having but i cannot resolve it.

    I'm self taught access and VB coding. so if its conplex please send me arrows to what to search and display.

    I'm using access 2013,
    however the database needs to work in access 2003.

    i have two tables:
    table1:
    CusID - unique primary
    CusNumber
    etc...


    table two:
    RawID - Unique Primary
    CusID - Lookup link to table one CusID
    etc...

    I have one form where you can search for all the customers using a query. this displays in a subform on the same form.

    double clicking on the CusID in the subform opens a second form (CusDetails).
    this displays a second form(CusDetails) which displays all the customer details of the customer selected. It also displays a query via a subform that displayes all the orders placed by the customer.

    I want to click on the [RawID] in this subform and open another form (CusOrders) that displays the specific order details in tabbed page.

    I'm using the following code:

    Private Sub RawID_DblClick (Cancel As Interger)
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "CusOrders"
    stLinkCriteria = "[RawID]=" & Me![RawID]

    DoCmd.OpenForm stDocName, , , stLinkCriteria
    Exit Sub
    End Sub

    This opens the form but displays no details.

    if i add acFormReadOnly, I get a blank form.

    Many thanks in advance for any pointing or help

    thanks

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    you actually should have a single record for CUSTOMER - subform (custorders) , to get the parent-child effect.
    in the form that returns results from the search
    put a button in the header so when the user picks a customer, click button , to open the 1 customer form, with subform(custorders)
    DoCmd.OpenForm "frm1Cust", , , "[clientID]=" & txtID

    This will ensure PARENT-CHILD integrity. The suborm can have tabs. The tab.change() event will swap dataset in the subform.
    select case tab.value
    case "Orders"
    subForm.form.sourceobject = "frmSubfrmCliOrders"
    case "history"
    end select

Posting Permissions

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