Results 1 to 2 of 2

Thread: showing an sql query result in a textbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    89

    Question showing an sql query result in a textbox

    hello everyone
    in access, how can i view the results of an sql select query in a textbox or in a flexgrid
    and how i can execute the query from the vba code page?
    aymun

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    In DAO

    VB Code:
    1. Dim strSQL as String
    2. Dim db as DAO.Database
    3. Dim rs as DAO.Recordset
    4.  
    5. strSQL = "SELECT * FROM tblFoo WHERE fldID = 1"
    6. Set db = CurrentDB
    7. Set rs = db.OpenRecordset(strSQL)
    8. If rs.Recordcount > 0 Then
    9.    rs.MoveFirst
    10.    txtFoo.Text = rs!fldID
    11. End If
    Tengo mas preguntas que contestas

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