-
Ok so my butts gonna be in the doghouse if i dont get this prog done soon for my g/f. I have a database that has a data control and it works just fine except for that it adds blank rows to the new database when i click add... My main properties are BOF = Move First and EOF Move Last..... How do i get rid of these blank rows?
my add button just has
data1.refresh
data1.recordset.addnew
data1.recordset.update
any Ideas?
Please Help :)
-
I can sympathise with you! :)
With regard your problem, it's quite difficult to say without looking at your app, but there is one thing I thought of.
Whenever you put values into your textboxes (presumably...) and close the form, the record automatically gets added to the database. That is why you are getting blank rows, because the Add button is adding a new record, then updating it (with nothing), moving onto the next record, then you close the form and the values you typed get added to the database, so you end up with blank records! Confused??!!
Try this: on form load, add a new record. Then when the form is closed, the values get saved automatically and it should solve your problem.
Good luck,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it :)
-
Now i am getting a data type conversion error? whatever that one means.... On your post you say that i should put an addnew in the formload event should i do that on the first form or the form that shows the new db info? I put it on the new db form and now i get those errors
-
Oh yes - i forgot. It would appear the Data control needs a little time to "initialise", so I get around this by having a timer set to 500 or so, which you should put on the Add form. So in Yimer1_Timer, put
Code:
Timer1.Interval = 0 ' stop timer from going more than once
Data1.Recordset.AddNew
That works fine for me. If it still throws a wobbly, try increasing the timer interval. If it still complains after waiting 5 minutes ( :)), then it must be something else. Like i said it's difficult to say without seeing exactly what's going on.
Good luck,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it :)