Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    118

    Question Unanswered: loading data from a table into a textbox

    hi,

    I have a small program that builds a string in 2 separate text boxes. I am using recordset to save that data into a table:

    Code:
    Private Sub SaveF_Click()
    
    On Error GoTo err_handler
    
    Dim dB As Database
    Dim rs As Recordset
    Dim strsql As String
    
    Set dB = CurrentDb
    Set rs = dB.OpenRecordset("filtertable", dbOpenDynaset)
    
    rs.AddNew
    rs!fName = Me.fName
    rs!SQL = Me.FilterBox
    rs!Filter = Me.ResultBox
    rs.Update
    
    err_exit:
        Exit Sub
        
    err_handler:
        MsgBox Err.Number & " " & Err.Description
        Resume err_exit
    
    
    End Sub
    I also need to load that data back to the texboxes when the user presses a button. Can anyone show me what the code would look like?

    I'm a total newb when it comes to recordsets...

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Maybe I'm not understanding your question, but couldn't you just reverse your = operator?

    Me.fName = rs!fName
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Mar 2004
    Posts
    118
    Yes you can, I already solved the problem thanks. Just need to do a FindNext statement and an If Not rs.MatchNotFound...

Posting Permissions

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