Problem with ListBox in Subform on tabbed form (Access 2003)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application with 5 forms, each containing one or more list boxes
used for selecting required options. It works very well like this, but I
would like to alter it to use a main form with a tab control on it. Each tab
page would contain one of my original forms as a sub form.

For some reason when I make the change, the list boxes no longer work. They
initialise correctly, but clicking on them does not produce any click or
update events, and the selection does not change. Command buttons on the same
tab page do work as expected. I have checked that the list boxes are enable.
What can be stopping them from following mouse clicks on them?
 
I have an application with 5 forms, each containing one or more list boxes
used for selecting required options. It works very well like this, but I
would like to alter it to use a main form with a tab control on it. Each tab
page would contain one of my original forms as a sub form.

For some reason when I make the change, the list boxes no longer work. They
initialise correctly, but clicking on them does not produce any click or
update events, and the selection does not change. Command buttons on the same
tab page do work as expected. I have checked that the list boxes are enable.
What can be stopping them from following mouse clicks on them?

What's the Recordsource of your main form (if any)?

Do the listboxes reference other controls on the form, either in their
Rowsource or in code? If so, making the form into a Subform changes how the
name of the form must be referenced: you need to say

Forms!mainformname!subformcontrol.Form!controlname

instead of

Forms!formname!controlname

John W. Vinson [MVP]
 
Thanks for your reply, john
What's the Recordsource of your main form (if any)?

The main form has no RecordSource
Do the listboxes reference other controls on the form, either in their
Rowsource or in code?

No they do not refer to any other controls. Their Rowsource is a selection
from mysyobjects (to get all available reports and queries)
If so, making the form into a Subform changes how the
name of the form must be referenced: you need to say

Forms!mainformname!subformcontrol.Form!controlname

instead of

Forms!formname!controlname

That is useful to know. But I've not been able to work out how to reference
a control in a subform on a tabbed control. Presumably the subformcontrol!
nees to become something like tabcontrol!pagename!subformcontrol!
 
That is useful to know. But I've not been able to work out how to reference
a control in a subform on a tabbed control. Presumably the subformcontrol!
nees to become something like tabcontrol!pagename!subformcontrol!

The tab control doesn't affect the referencing AT ALL. Controls on a Tab are
referenced in exactly the same way as controls not on a tab.

The tab control is just a way to arrange screen real estate; it doesn't affect
control names or control referencing at all.

John W. Vinson [MVP]
 
Thanks for that, John.

By the wat I've solved my problem with the list boxes. The main form on
which the tabbed control and sun forms were put, was set not to allow edits
or data input. By allowing edits on the form, the list boxes now work.
 

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

Back
Top