Command Button

C

Chris

I have a command button on a form that exports data via an
excel spreadsheet. Sometimes the user double clicks the
button which will export it twice. The second time the
spreadsheet is empty because it marks them as being sent
the first time and the empty file will overwrite the first
one. I could add a date and time stamp to the naming of
the file but we don't really need to keep them.

Is there a way to mark a button as single click only and
prevent it from being double clicked or single clicked
twice to prevent the sungle click event from firing twice.

Thanks for your help,

-Chris
 
G

Guest

Hi Chris,

I have a couple of similar situations with my client's database. If you
have any sort of a reference to your marked "sent" field on your form, you
could program your command button to only export if the "sent" field is null.

Something like:

If Not IsNull([Sent]) Then
MsgBox("Data has already been exported")
Else: (Enter your command button's current code to process your export)
End If
 
G

Guest

Excellent!! Great Idea!

Thanks for your help
-----Original Message-----
Hi Chris,

I have a couple of similar situations with my client's database. If you
have any sort of a reference to your marked "sent" field on your form, you
could program your command button to only export if the "sent" field is null.

Something like:

If Not IsNull([Sent]) Then
MsgBox("Data has already been exported")
Else: (Enter your command button's current code to process your export)
End If


Chris said:
I have a command button on a form that exports data via an
excel spreadsheet. Sometimes the user double clicks the
button which will export it twice. The second time the
spreadsheet is empty because it marks them as being sent
the first time and the empty file will overwrite the first
one. I could add a date and time stamp to the naming of
the file but we don't really need to keep them.

Is there a way to mark a button as single click only and
prevent it from being double clicked or single clicked
twice to prevent the sungle click event from firing twice.

Thanks for your help,

-Chris
.
 

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