Results 1 to 1 of 1

Thread: [RESOLVED] Acces Basic table refreshing

  1. #1
    Member
    Join Date
    Jun 05
    Location
    Poulsbo, WA
    Posts
    60

    Resolved [RESOLVED] Acces Basic table refreshing

    Hope this is the right place for this.

    My Access 2000 application has a function to add records to a data table from an import table that works fine. I can't display the added record on a subform though.

    Any thoughts?

    Adding the record -
    TCPRTable.AddNew
    TCPRTable![SC] = SC

    (More fields here)

    TCPRTable.Update

    Screen.ActiveForm.Refresh
    MsgBox "Record added"
    TCPRTable.Close

    Exit Sub


    Search for added record-
    Set DB = DBEngine.Workspaces(0).Databases(0)
    Set TCPRTable = DB.OpenRecordset("SELECT *FROM [DataTable]")

    Input1 = InputBox("Param1", "Search parameter 1")
    Input2 = InputBox("Param2", "Search parameter 2")
    Input3 = InputBox("Param3", "Search parameter 3")


    TCPRTable.MoveFirst
    Do While Not TCPRTable.EOF
    If TCPRTable![Param1] = Input1 And TCPRTable![Param2] = Input2 And TCPRTable![Param3] = Input3 Then
    Me![SC] = TCPRTable![SC]

    (more fields here)

    TCPRTable.Requery
    Screen.ActiveForm.Refresh
    End
    Else: TCPRTable.MoveNext
    End If

    Loop
    End Sub

    I should mention that the added records will display if the DB is shut down then re-opened.
    Last edited by KidJavelin; Jan 27th, 2006 at 12:05 PM.

Posting Permissions

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