How does one improve ADODC add/delete methods? 
Author Message
 How does one improve ADODC add/delete methods?

Hi,

I have an ADODC control on a form but am not pleased with the error messages
it creates with the Add or Delete records.

I have created four new buttons that work great for move first, move
previous, move next, and move last.  However, I seem to get error messages
with the ADD and DELETE buttons.  For instance, what code could i use so the
user cannot delete the first record (and not show any errors).  Also with
the add button, what code could i use so if the user hits ADD a few times it
wont hang me up with errors.

Basically I want clean ADODC controls that won't allow for user errors.  Any
help or suggestions?

--Matt



Fri, 17 Aug 2001 03:00:00 GMT  
 How does one improve ADODC add/delete methods?

Quote:
>I have created four new buttons that work great for move first, move
>previous, move next, and move last.  However, I seem to get error messages
>with the ADD and DELETE buttons.  For instance, what code could i use so the
>user cannot delete the first record (and not show any errors).  Also with

If, by '1st' record, do you mean the record under 'movefirst', when you open
the recordset, you can save the bookmark to a variable, and compare it when
the user tries to delete the record. If they're the same, simply don't do
the delete.

Quote:
>the add button, what code could i use so if the user hits ADD a few times it
>wont hang me up with errors.

There are a couple of ways. One way that a lot of people seem to like is to
simply disable the add button when it is clicked. Re-enable it when the
update or cancel is handled.

Another alternative is to set a flag when the user hits 'add'. When the user
clicks add, check the flag. If it's set, don't do any of the code. If it's
not set (reset), then set it and do the add code. On the update or cancel,
reset the flag (check it first if you like, but it shouldn't be necessary).

You might want to consider the same sorts of things on an 'edit' too.

Quote:
>Basically I want clean ADODC controls that won't allow for user errors.  Any
>help or suggestions?

You have far more faith in your users' lack of imagination than I do. Users
will always find a way.

Alan


(with a 'p' on 'alan' making it 'alanp',
and no spaces). I'm sick of email spam.



Sat, 18 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to add/delete/edit user in access by VB programming using ADODC

2. Print one record from one simple Acess dababase with Adodc

3. Deleting all records then adding new ones in a single update

4. Checking if a delete will succeed (without doing the delete)

5. How to improve the resolution of one bitmap?

6. Delete item from a collection class that has no Delete method

7. Repost ( Improved Program) VB3.0 for Hourly Wage (Reset Button Added) - Vb3-hr-w.zip

8. Treeview: Nodes.Clear method slower than removing one-by-one

9. Adding records with one-to-one relationship

10. Run-time error -2147467259 (80004005) when using adodc refresh method

11. no UpdateControl method in AdoDC

12. ADODC controls with only one connection ?

 

 
Powered by phpBB® Forum Software