command button on worksheet

G

Guest

I have a worksheet which has 2 cells unprotected to accept a date and a
clientID respectively. I also have a commandbutton with a macro behind it to
take the two cell values and pass them to a SQL query which returns results
to another section of the worksheet.

When using the sheet there is a tendency to input the date, tab to the
client ID, key in the ID and then click on the command button. Unfortunately,
until the client ID field has lost the focus, the command button has no
effect. If the user presses <enter> or tabs out of the clientID cell then the
button works fine.

I'm sure this must be easy to fix. I would really appreciate some help.

Thanks.
 
G

Guest

Actually, I don't think it is easy to fix. If the user remains in edit mode
(what you describe), then macro don't run. I think you could mitigate it by
using Data validation in the clientID cell using the list option so the user
is presented with a dropdown and choices to choose from.
 

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