RexesOperator
Registered User.
- Local time
- Today, 10:24
- Joined
- Jul 15, 2006
- Messages
- 604
I have looked at the Microsoft site and various examples in the forum. There seems to be a couple of approaches. I just want to make sure I understand how to do this.
I have two tables with a one-to-many relationship - tblCompanies and tblContacts. I want to use a bound form tied to a query - qryTransactionDetails that holds the search fields CompanyID and ContactID (among other fields). I want two use two cascading combo boxes cboCompanyId and cboContactID.
For the cboCompanyId I have:
Row Source Type: Table/Query
Row Source: qryTransactionDetails
Bound Column: 1
for the after update event (using the Microsoft example) I have:
Private Sub cboCompanyID_AfterUpdate()
Me.cboContactID.RowSource = "SELECT ContactID FROM" &_
" cboContactID WHERE CompanyID = " & Me.CompanyID &_
" ORDER BY cboContactID"
Me.cboCompanyID.Requery
End Sub
For the cboContactID I have
Row Source Type: Table/Query
Row Source:
Bound Column: 1.
ATM I just have the two fields in the query so I am not concerned with referencing columns/column widths etc.
Is this correct so far?
I have two tables with a one-to-many relationship - tblCompanies and tblContacts. I want to use a bound form tied to a query - qryTransactionDetails that holds the search fields CompanyID and ContactID (among other fields). I want two use two cascading combo boxes cboCompanyId and cboContactID.
For the cboCompanyId I have:
Row Source Type: Table/Query
Row Source: qryTransactionDetails
Bound Column: 1
for the after update event (using the Microsoft example) I have:
Private Sub cboCompanyID_AfterUpdate()
Me.cboContactID.RowSource = "SELECT ContactID FROM" &_
" cboContactID WHERE CompanyID = " & Me.CompanyID &_
" ORDER BY cboContactID"
Me.cboCompanyID.Requery
End Sub
For the cboContactID I have
Row Source Type: Table/Query
Row Source:
Bound Column: 1.
ATM I just have the two fields in the query so I am not concerned with referencing columns/column widths etc.
Is this correct so far?