Results 1 to 17 of 17

Thread: Getting data from access to VB

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    9

    Getting data from access to VB

    Can anyone help me about this?
    the VB highlight the code
    txtname1.Text = rs.Fields("Name")
    and the number in txtid1.Text always being 1
    and i can't change the number in this textbox

    Code:
    Private Sub txtid1_change()
    FOOD = "Select * from menu"
    Set rs = New ADODB.Recordset
    rs.Open FOOD, conn, adOpenKeyset, adLockOptimistic
    If Not rs.EOF And Not rs.BOF Then
    txtid1.Text = rs.Fields("Food ID")
    txtname1.Text = rs.Fields("Name")
    rs.MoveNext
    rs.Close
    End If
    End Sub

    It says "Operation is not allowed when the object is closed"
    Last edited by karsen; Dec 17th, 2008 at 03:06 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
  •  



Click Here to Expand Forum to Full Width