Results 1 to 4 of 4

Thread: Important Question Needs Answer ASAP or my Butts On The Line Here

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Rhinelander, WI USA
    Posts
    59

    Post

    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



  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Rhinelander, WI USA
    Posts
    59

    Post

    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

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width