Main form Combobox and subform

G

Gajanan

I have placed one combo box on main form. It contains the primary kyes or
record. I also added subform on this form which is bind to the query. I want
to populate this subform on the basis of value selected in combo box. How can
I do it?
I have tried_
Binding the subform to combo box by setting Child field and master field
properties but it is giving error "Unlinked forms can not be bound"
Please help.
 
R

Ron2006

I have placed one combo box on main form. It contains the primary kyes or
record. I also added subform on this form which is bind to the query. I want
to populate this subform on the basis of value selected in combo box. How can
I do it?
I have tried_
Binding the subform to combo box by setting Child field and master field
properties but it is giving error "Unlinked forms can not be bound"
Please help.

You probalby are getting this by trying to use the wizard. The
statement is not completely accurate.

You can link the forms but you just have to do it manually.

type in the names of the two fields (Use [] if there are spaces in the
field names) into the child and parent boxes of the data tab on the
form properties.

Ron
 
O

OldPro

I have placed one combo box on main form. It contains the primary kyes or
record. I also added subform on this form which is bind to the query. I want
to populate this subform on the basis of value selected in combo box. How can
I do it?
I have tried_
Binding the subform to combo box by setting Child field and master field
properties but it is giving error "Unlinked forms can not be bound"
Please help.

There are several ways to do this. Here is one way:
1) Use just one form.
2) In the RecordSource property of the form, put a reference to the
table you want to edit/display.

3) Add a combobox (Combobox1)with the RecordSourceType set to Table/
Query, and the RowSource set to a SQL query that retrieves all of the
possible key fields.
4) In the change event of the combobox, put the code to locate the
record:
DoCmd.GoToControl "SomeKeyField"
DoCmd.FindRecord Me.Combobox1
5) Add any other fields that you wish to display from the fieldlist.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top