Results 1 to 3 of 3
  1. #1
    anggunpus is offline Novice
    Windows XP Access 2007
    Join Date
    May 2009
    Posts
    2

    sql = "Select * From qry_defect" >> ??

    I have source code in VBA
    here is:

    Private Sub Command1_Click()
    Dim rs As Recordset
    Dim sql As String
    Dim qcatt As QCAttrib ' Create object variable.

    sql = "Select * From tbl_defect" 'select from table
    Set rs = CurrentDb.OpenRecordset(sql)
    rs.OpenRecordset
    Set qcatt = QCAttrib1.Object


    qcatt.CCReset
    ............................


    Why I can't change sql = "Select * From tbl_defect" select from query??
    Can you help me?

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Your recordset is based upon the sql string. Modify the sql string or use the rs.FindFirst and rs.findNext commands to fins specific criteria. I presume that you're stepping though the recordset.

    Query sql string are modified using the QueryName.sql property.

  3. #3
    anggunpus is offline Novice
    Windows XP Access 2007
    Join Date
    May 2009
    Posts
    2
    okay thank you!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  2. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  3. Select "autonumbers" not in sequence
    By jerry525 in forum Queries
    Replies: 5
    Last Post: 11-09-2008, 02:48 PM
  4. Replies: 2
    Last Post: 08-31-2006, 12:19 PM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 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
  •  
Other Forums: Microsoft Office Forums