-
With the ado data control is there a way to be able to go back and look at the other records? What I mean is this: I will go and add a new record and then change my mind. But when I go to look at the other records, I get an error saying that I can't leave the record blank. Is there any way around this?
Thanks!!
-
I think you need to use the cancel method before you try to navigate through the recordset.
-
How do you use the cancel method?
-
I have to correct my previous post. It isn't the cancel method you want to use. It is the cancelupdate method. To call that you'd have to have a command button with the code
if adodc1.recordset.editmode <> editnone
adodc1.recordset.cancelupdate
Are you only using the data control or do you have command buttons in there too? By the sounds of it you have the data control add a record when you get to the end of the recordset.
The data control is good for quick database access with little functionality, but usually you'd have a data control that is invisible with command buttons to add, delete and navigate through the recordset. You could do the same thing with no data control, just database and recordset variables.
-
I have cmdupdate, cmddelete, cmdclear, and cmdadd. Where would I put this code? I have tried it in form_load, cmdupdate, cmdadd.
-
If you are using VB 6, I'd recomend that you go into the add in manager (under the add-ins) menu and load the data form wizard. You can use the data form wizard to create a data form that uses either a ADO data control, or ado code. The form it will create will give you ideas on how to code your form. It won't have all the bells and whistles but it will be fully functional (It's actually not a great user interface, but it gives coding ideas).
When you get away from using just the data control you will have a form that is MUCH more functional, but then you will get into many more issues. The coding will get MUCH more comples especially if you build it to be used in a multi user enviornment.