stoping a query in an disabled combobox

  • Thread starter BBC via AccessMonster.com
  • Start date
B

BBC via AccessMonster.com

I have combobox (on a subform used as a record selector) filled by a query
that under certain circumstances cannot have any action associated with it,
ie the query must not even execute.
I have disabled and locked the control but the query still happens late in
the form load process (but not directly by my VBA code). The reason I need
to stop it is that the query references a control in a Form that isn't loaded
under these circumstances. ie I have 2 forms that load this same subform
which use 2 different record selection techniques so when the alternate is
being used this one must not happen.

The "error" appears as a you must "fill in the query parameter" requesting
the other form's information
How can I stop this (maybe programatecially setting the comboboxes rowsource
to the query or null or will that give an error)

About as clear as mud ?
 
J

Jeff Boyce

The referents are a bit dodgey ... is it the combobox that must not have an
action or the query?

As long as you have a query "feeding" a combobox, I'm pretty sure that the
form will, as part of the load process, have that combobox check its source.

One approach might be to NOT have a source for the combobox until your
circumstances are met, then set the source to the query.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

BBC via AccessMonster.com

Thanks,
Yes it is the combobox's query that is causing the problem (the only one left
on the form)

Your suggested solution was sort of what I was begining to think, In fact if
I'm doing that I might as well use the same combobox, just switch it's query
(based upon a flag I have) and then just modify the other code as necessary

Jeff said:
The referents are a bit dodgey ... is it the combobox that must not have an
action or the query?

As long as you have a query "feeding" a combobox, I'm pretty sure that the
form will, as part of the load process, have that combobox check its source.

One approach might be to NOT have a source for the combobox until your
circumstances are met, then set the source to the query.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
I have combobox (on a subform used as a record selector) filled by a query
that under certain circumstances cannot have any action associated with
[quoted text clipped - 16 lines]
About as clear as mud ?
 

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