Results 1 to 2 of 2

Thread: Updating a database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    south africa
    Posts
    16

    Post

    I have this DBgrid that retrieves records from the database based on a certain criteria.The question is, when a retrieved record is selected either by double clicking on it or clicking a command button(Select), a form that was used to save changes must appear for a user to update.

    Can someone please tell me the code that I can use to achieve this.

    Thanks.

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    frmSave =a form that was used to save changes must appear for a user to update

    frmGridsForm = form with the grid on it


    In the DBGrid_click or dblClick event and the cmdSelect_click event:

    frmSave.show 1 'opens the form

    'then in the frmSave_load event:

    intRow = frmGridsForm!DBGrid.row
    intCol = frmGridsForm!DBGrid.col

    'now you have the row and col, it should give you the record you want to edit

    if the record Key is in the first col -

    frmGridsForm!DBGrid.col = 0
    strRecordKey = frmGridsform!DBGrid.text

    then just connect to your db and grab the info. Hope this helps.

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