Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    117

    Unanswered: Searching & Replacing Field values

    Hello sir,
    I am using VB with Ms-Access 2003
    I need to replace my recordset values.
    My rcordset named "check" has no1 fields which contain datas like this 11-2, 5-4, 5, 6.
    Here i want to replace 11-2 by 11/2 and also 5 by 5/1 like that for all the datas
    I used the below coding but not working, Pls help me in this coding.

    Dim db As New ADODB.Connection
    Dim rs As New ADODB.Recordset

    Private Sub Command1_Click()
    rs.Open "check1", db, 3, 2 ' I opened recordset

    currentdb.Execute "update check1 set rs.Fields(0) = Replace(rs.Fields(0), " - ", " / ")" ' here i tried to change the values

    End Sub

    Private Sub Form_Load()
    db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Bharani\Desktop\New Folder (2)\check.mdb;Persist Security Info=False"

    End Sub

    Thank you sir.

  2. #2
    Join Date
    Feb 2004
    Posts
    214

    there is already a thread for this

    Since you were working with Pootleflump, you should probably wait for his answer when he logs back in.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

Posting Permissions

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