Originally Posted by
Minty
If you have a slow network problem then some improvements can be made;
Make sure you only retrieve the records you want to work.
Load forms initially with no records e.g. SELECT * FROM YourTable WHERE PrimaryKeyID = 0
Then only load a specific set of records you want after a search.
Are all your subforms displayed at the same time? If they are on tabs, only load the subform on the tab that is visible.
This can make a big difference.
So I am new to databases working this way as usually they are small and speedy.
This is the code I have for querying which I am assuming because of the Me. it needs the form to be loaded with data first before it can query or it will find no results every time.
Code:
Option Compare Database
Private Sub Command36_Click()
Dim sWhere As String
sWhere = "1=1"
If Not IsNull(Me.txtCode) Then sWhere = sWhere & " and [PROD_CD]='" & Me.txtCode & "'"
If Not IsNull(Me.txtCarrier) Then sWhere = sWhere & " and [SUB_LOC_CD]='" & Me.txtCarrier & "'"
If Not IsNull(Me.txtMCode) Then sWhere = sWhere & " and [MKT_CD]='" & Me.txtMCode & "'"
If sWhere = "1=1" Then
Me.FilterOn = False
Else
Me.Filter = sWhere
Me.FilterOn = True
End If
End Sub
Private Sub Command40_Click()
Me.FilterOn = False
Me.txtCode = Null
Me.txtCarrier = Null
Me.txtMCode = Null
Me.Refresh
End Sub
This is what the form looks like
Main form with 2 sub forms.
I am unsure how to start with the querying of the empty form.
Any help you can provide would be awesome