Results 1 to 11 of 11

Thread: updating dbgrid

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106

    Question

    hello, i'm trying to update dbgrid with coding... say if they tried to add a new record, then i get a name and the age with inputbox and then i do it with a code
    like

    datexample.addnew ...' add and then refresh
    datexample.refresh
    however, it does not show on the dbgrid. but if i exit the program and start it back, it shows... i know it's kinda confusing but help... i want it to show the newly added record without exiting and restarting the prog

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96
    Try using
    Code:
    datexample.requery
    This requeries your recordset and rebuilds it. You may need to refresh your view depending on what type of dbgrid you have.
    Just trying to muddle through...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    i tried .requery but i get an error saying that member or data member not found

  4. #4
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96
    How do you actually add your information to the recordset?
    Just trying to muddle through...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    i link textboxes with the datarecordset items and then i do addnew method... the thing is that, dgbrid updates, that is shows the result when i delete a record and the do a data.refresh method

  6. #6
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96
    How do you populate your recordset?

    (I had a similar problem last month and using requery solved it for me.)

    Just trying to muddle through...

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    sorry but i don't know what you mean by populating

  8. #8
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96
    how do you put your information into the recordset datexample?

    (sorry about the 20 questions)
    Just trying to muddle through...

  9. #9
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96
    Just looking back at your code:

    I assumed that datexample is a recordset - is that the case?
    What is the name of your dbgrid?

    if datexample is a recordset then try refreshing your dbgrid as well
    i.e after the record has been added - dbgrid.refresh or call the form refresh procedure

    let me know if that works

    H.

    Just trying to muddle through...

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    i did that and it still doesnt work... i mean i refreshed the dbgrid as well as the recordset.. and still have the same problems

  11. #11
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96

    Question

    hmmmm.....

    I'll need to have another think about this one

    H.

    Just trying to muddle through...

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