AngelinaPerez

I am just wondering if anyone knows how I can tackle this problem. How can I alert the USER using a dataform that they have inadvertently clicked on the ADD NEW button once before. Thanks your help highly appreciated.



Re: Visual Basic Express Edition User alert!

EverydayHack

This a winform or a web page or.....

You could have a increment counter on the "add new" button event. Then the event will check to see if it has happened mulitple times.

The problem is you have to figure out what user procedures constitutes a completed record. If you update a records with any field more than three characters in any one field of the form, you could reset the increment counter......

If its a winform the infamous MsgBox("Hey sucka, you jes done dis.") always works for me.

Probably easier to move the addnew button somewhere harder to get to, consider removing it form the tab sequence






Re: Visual Basic Express Edition User alert!

js06

Private Sub BindingNavigatorAddNewItem_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles BindingNavigatorAddNewItem.MouseDown

Me.BindingNavigatorAddNewItem.PerformClick()

Me.BindingNavigatorAddNewItem.Enabled = False

End Sub

now from what i have just experienced when they are done editing it should enable the button automatically for you






Re: Visual Basic Express Edition User alert!

Paul_Neilsen

How do you go about this, EverdayHack I am just a VB newbie. Take it easy on me! I am using Windows form
.




Re: Visual Basic Express Edition User alert!

js06

Paul,

I am guessing that you are trying to prevent someone from clicking the add new button and then clicking it again right away.

To prevent them from trying to add 2 records at the same time which gives and error.

Is this what you want

If so then the code i gave above will do this for you

When they click the button it disable the button and then add a new record

Once they are through editing then it will enable the button for you

No need to keep track of it

Or am i misunderstanding what you are trying to do






Re: Visual Basic Express Edition User alert!

Paul_Neilsen

Thanks very much. Like you rightly said I want them to get an alert warning them they've clicked ADD NEW button once before, and this alert should force them to complete the data entry earlier.





Re: Visual Basic Express Edition User alert!

=Steve D=

I'd just disable the "Add New" button when they click it (AddNew.Enabled = False). That way they can't click it twice. Once they've finished their data entry enable it again.