Subform to MainForm unbound control

D

Dkline

My main form has a list box lstPolNum whose row source is
qryPolicyNumberAlpha.

I want to add a set of subforms synchronized by the selection in the list
box. Right now I click on the list box, select a command button for a
report, and I get a report synchronized with the list box selection.

That list box is unbound. When I try to link, I get "Can't build link
between unbound forms".

How can I synchronize these?
 
K

Kelvin

Since your list box is unbound the only way to "synch" the subforms would be
to have each subform as independent forms (no master/child link) showing
every value in its record source. Then in the AfterUpdate event of the list
box, filter each subform to match the selection, requery each form, then
refresh the subforms.

Why can't the list box be bound?

Kelvin
 
D

Dkline

Sorry it's taken so long for me to reply. I got pulled on to a project with
higher priority.

When I bind the control and then attempt to use it, upon click I get the
error message "Control can't be edited; its bound to the expression
[qryPolicyNumAlpha]"

When I originally did this using reports I did create a function that would
do the requery. Each report had a command button to launch it from the form
on the click event.

I suppose that's what I'll have to do here.

What is the corrrect way to setup the list box?

I don't want to edit the record, I just want to make the selection by
clicking on the list box and have the subforms or reports appear based on
the selection on the list box on the main form.
 
K

Kelvin

You will need to use the AfterUpdate event of the list box like I mentioned
to perform the functions you need. You can change the source of the subform
using

Forms!frmMain!frmSubForm.Form.RecordSource = Forms!frmMain!txtListBox

To open a report use

DoCmd.OpenReport Forms!frmMain!txtListBox

Kelvin

Dkline said:
Sorry it's taken so long for me to reply. I got pulled on to a project with
higher priority.

When I bind the control and then attempt to use it, upon click I get the
error message "Control can't be edited; its bound to the expression
[qryPolicyNumAlpha]"

When I originally did this using reports I did create a function that would
do the requery. Each report had a command button to launch it from the form
on the click event.

I suppose that's what I'll have to do here.

What is the corrrect way to setup the list box?

I don't want to edit the record, I just want to make the selection by
clicking on the list box and have the subforms or reports appear based on
the selection on the list box on the main form.

Kelvin said:
Since your list box is unbound the only way to "synch" the subforms
would
be
to have each subform as independent forms (no master/child link) showing
every value in its record source. Then in the AfterUpdate event of the list
box, filter each subform to match the selection, requery each form, then
refresh the subforms.

Why can't the list box be bound?

Kelvin
 

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