Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Link Unbound Controls from Main Form to Subform

Status
Not open for further replies.

starlitskies

Technical User
Feb 7, 2005
16
CA
I have a main form with controls that are unbound and I have my subform that uses its data source from a query.

I've set the Link Child Fields to the unbound combo box 'cboClientID' in the main form and the Link Master Fields to the 'ClientID' field from the appropriate table. Both contain the same type of data but Access is still unable to load the subform.

Any ideas please?
 
Typo above. My apologies.

The Link Child Fields refers to the ClientID field in the subform and the Link Master Fields refers to the 'cboClientID' in the main form.
 
So by loading the record from the unbound combo box on the main form, the subform should load the corresponding record in the subform. Cool.

Try the Requery method with the AfterUpdate event procedure for the combo box.

Code:
me.YourSubForm.Requery

Another approach, especially if you add more conditions on your main form, such as date ranges is to build a SELECT / WHERE clause and change the RecordSource of the subform.

Code:
'Build your SQL statement

Me.YourSubForm.Form.RecordSource = strSQL
Me.sbfrmOrganizationCosts.Requery

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top