Question : access vba Forms Clear cancelEvent

I have a single form which creates a new record in one of two tables depending on which button is clicked. The form is bound to table1 and works fine from button1. However when I use button2 it creates table2 record ok, but also creates table1 record when user moves on. I added a before update event in the form to cancel the update to table1 when updating table2. this works fine for the first time and then thereafter I get an error "you cancelled the event". I don't know how to clear this for subsequent use.

Answer : access vba Forms Clear cancelEvent


the better idea would be to use an unbound form in this case and create the record in table 1 like you already do in button 2 for table 2. In this case you should not get in trouble.

But if you have a record structure which can be used in table 1 and table 2 I guess there is a problem in your data structure as in this case you normally only need to have one table with maybe an additional field to separate table1-data from table2-data.
In this case you can simply use a bound form and create this id in dependence of which button was clicked.


Random Solutions  
programming4us programming4us