Results 1 to 2 of 2

Thread: help with query

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Posts
    118

    Post

    Hi I am trying to build a program and have a small problem. The main problem
    is that my program is Too slow. is there a better way to do this ? I am
    using an MS Access Database with one table.
    Thanks for any help:
    Here is the code.
    Private Sub Command1_Click()
    Dim strSQL As String

    strSQL = "SELECT Vender,PartNumber,FGNumber FROM cross_references " & _
    "WHERE (PartNumber = """ & Text1 & """);"

    Me.Data1.RecordSource = strSQL
    Me.Data1.Refresh
    MSFlexGrid1.ColWidth(0) = 1575
    MSFlexGrid1.ColWidth(1) = 1575
    MSFlexGrid1.ColWidth(2) = 960
    Call Command2_Click
    End Sub

    Private Sub Command2_Click()
    strSQL = "SELECT Vender,PartNumber,FGNumber FROM cross_references " & _
    "WHERE (FGNumber = """ & Text2 & """);"
    Me.Data1.RecordSource = strSQL
    Me.Data1.Refresh
    MSFlexGrid1.ColWidth(0) = 1575
    MSFlexGrid1.ColWidth(1) = 1575
    MSFlexGrid1.ColWidth(2) = 960
    End Sub



  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Try adding indexes on the PartNumber and FGNumber, see if that helps.

    Also if you have a large database that is being accessed over a network, your app will be slow because of the data transfer that is necessary when you manipulate the data....

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