button invisible when focus ?

W

Wim

Hi all,

I have a button (save record) which has lines of code in
order to update all relevant tables. It works fine, but,
in a network environment, impatient people sometimes click
several times on it, so it generates a duplicate key error.
How can I make this button invisible, immediately after
the onclick event - it has the focus though ! - , so that
the code can work at ease and without generating any
unwanted duplicate key errors ?

Thanks for your answer,

Wim
 
M

Marshall Barton

Wim said:
I have a button (save record) which has lines of code in
order to update all relevant tables. It works fine, but,
in a network environment, impatient people sometimes click
several times on it, so it generates a duplicate key error.
How can I make this button invisible, immediately after
the onclick event - it has the focus though ! - , so that
the code can work at ease and without generating any
unwanted duplicate key errors ?

Just set the focus to a different control.

Consider disabling the button instead of making it
invisible.
 
I

Ian

-----Original Message-----
Hi all,

I have a button (save record) which has lines of code in
order to update all relevant tables. It works fine, but,
in a network environment, impatient people sometimes click
several times on it, so it generates a duplicate key error.
How can I make this button invisible, immediately after
the onclick event - it has the focus though ! - , so that
the code can work at ease and without generating any
unwanted duplicate key errors ?

Thanks for your answer,

Wim
.

Reply,

Don't know about making it invisable but how about this
for a solultion.

In the first line of your code try to open another form
or msg box and give them a few buttons to press that do
absolutly nothing and when the system has written all the
files give then back control saying all records written.

Hope this helps

Regards & good luck

Ian
 

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