Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228

    Unanswered: re: problem wit code in recordsets (sorry for the new thread)

    I couldn't reply to the original thread ("Invalid thread specified" error).

    CarlosdB wrote:
    when i run this code

    Private Sub Command0_Click()

    Dim mydb As Database
    Dim Table As Recordset


    Dim i As Integer, j As Integer, X As Boolean

    Set mydb = CurrentDb()

    Set Table = mydb.OpenRecordset("Tbl:L2 BUDGET", DB_OPEN_DYNASET)

    Table.MoveFirst

    X = True
    Do While X = True


    If Table![ecode].Value = "12000" Then
    Table.Edit
    Table![spending] = "15000"
    Table.Update
    X = False
    Else
    Table.MoveNext
    End If
    Loop

    End Sub

    I got a message :"type dismatch" and stop runing in line set table=.....
    I need your help
    Set Table = mydb.OpenRecordset("Tbl:L2 BUDGET", DB_OPEN_DYNASET)

    Try to replace the "Tbl:L2 BUDGET" with "BUDGET" (if BUDGET is the table name). Did you convert this code from a previous access version? what version are you running now? the DB_OPEN_DYNASET constant was last used in Access 2.0 I think, newer versions now use the dbOpenDynaset constant although they still support the old one.
    Last edited by Apel; 05-17-02 at 06:52.

Posting Permissions

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