Find button not working

BJS

Registered User.
Local time
Today, 06:51
Joined
Aug 29, 2002
Messages
109
I have a series of combo boxes on a form.
Each combo box has a command button next to it, which allows the user to open a form which contains data in the combo boxes.

E.g.:
my combo box is cboCountry
my country maintenance form is frmCountry

I have added a find button on each of the combo box maintenance forms. The find buttons work fine on each of the forms only if I open them directly via the database window.

As soon as I open the maintenance forms via the command button on the form that contains the combo boxes, the find doesn't work. I get error message:

"The command or action 'Find' isn't available now."

Anyone know what is causing this?

Thanks,
BJS
 
Some more information that hopefully will help solve my problem:

The form (containing the combo boxes with a command button next to each of them) actually opens up to 1 filtered record.

So basically I am launching the combo box maintenance form from a button on a filtered form. Could this be why my find button doesn't work when I open the form from there? If so....any way around this?

Basically, I want the user to be able to add an item to the combo box if it doesn't exist.
 
What code are you using to open the form?

You have a filter when the form opens and the results are the current recordset for navigating. That means you only have the one record and selecting another within that filter just isn't possible.
 
Thanks Mile-O-Phile, you are correct in that my main form opens with one filtered record that is fine. On this filtered record is a combo box (cboCountry).

Let's say the user wants to modify the country field, but the combo box doesn't contain the new country. At this point, the user clicks on the button next to the combo box, which opens the form that contains all of the countries (this form is not filtered). This form contains the "Find" button, which doesn't work unless opening the form directly from the database window.

The code next to my command button is as follows:

DoCmd.OpenForm "frmCountryMaintain", acNormal, , , acFormEdit, acDialog
cboCountry.Requery

A workaround that I thought of would be to modify the code to go to the database window first and then open the maintenance form as follows:

DoCmd.SelectObject acForm, , True
DoCmd.OpenForm "frmCountryMaintain"
cboCountry.requery

I tested this and it works fine for users who use the licensed version of Access, but this database is distributed with Access Runtime, which doesn't allow access to the database window.

Any more suggestions?
 
O.K. My solution also worked for Access Runtime users. I just had to add one line of code to minimize the database window:

DoCmd.SelectObject acForm, , True
docmd.minimize
DoCmd.OpenForm "frmCountryMaintain"

I requery the combo box when exiting the maintenance form.

Thanks for the help!
BJS

:)
 

Users who are viewing this thread

Back
Top Bottom