PDA

Click to See Complete Forum and Search --> : help with query


paul
Feb 22nd, 2000, 11:05 AM
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

Clunietp
Feb 22nd, 2000, 11:34 AM
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....