Results 1 to 3 of 3

Thread: Refresh Rs without Updating

  1. #1

    Thread Starter
    Hyperactive Member maxl's Avatar
    Join Date
    Jan 2002
    Location
    Montréal
    Posts
    384

    Refresh Rs without Updating

    Is there anyway to refresh a recordset without updating it and not loose the data already entered.

    VB Code:
    1. rs.Open "SELECT T1.Foreign_Key, T2.Description_Of_The_FK FROM Table1 T1 INNER JOIN Table2 ON T1.Foreign_Key=T2.Primary_Key"
    2.  
    3. rs.AddNew
    4.  
    5. rs.Fields("Foreign_Key") = 1  'After the user enters the FK, I would like the other the field to show the correct Value corresponding to 1 in the description field
    6. 'I can't update because in my prog, there are other not null fields
    7. 'And I can't retrieve the value myself and put it in the description, because then the RS is gonna try to INSERT in Table 2.

    Is this possible ?? I don't think so, but maybe somebody has had something similar. Thanks
    COBOL sa suce !!!

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Use a disconnected recordset.

    Basically retrieve the records then close the connection to the db.
    You can still work with the recordset. But changes wont be made in the database.

    b

  3. #3
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    You don't want to refresh ,but want to filter the rs.


    You can use filter for this
    VB Code:
    1. rs.Filter = ""
    2. rs.Filter = "Foreign_Key = "  & 1
    3. ' to remove the filter use
    4. rs.Filter = ""
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

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