Form not showing correct record order

C

Cynd

I created a form with a subform that shows the related records. For all 7
main categories there is a list of items which show up alphabetized by level
and title. The data was entered in the table sorted by level and alphabetized
by title. When I pull up any of the categories except one the data shows
correctly. In the one category, for one level only, the data has records out
of order. The first 15 or so records do not show up until after the 30th
record. All of the records are in order up to that point, and including the
15 that are out of sync. I cannot determine any reason behind the problem.
Does anyone know why this is happening and how I can fix it?
 
B

Bernie

Cynd said:
I created a form with a subform that shows the related records. For all 7
main categories there is a list of items which show up alphabetized by level
and title. The data was entered in the table sorted by level and alphabetized
by title. When I pull up any of the categories except one the data shows
correctly. In the one category, for one level only, the data has records out
of order. The first 15 or so records do not show up until after the 30th
record. All of the records are in order up to that point, and including the
15 that are out of sync. I cannot determine any reason behind the problem.
Does anyone know why this is happening and how I can fix it?

I use the approach of manually linking main / subforms by either using sql
statements or queries. By using sql statements and queries, you can define
the sort sequence etc. I know it takes a bit of time to do so but it works.

Here is an example:

Private Sub Trip_Click()

strmainform = Me.Form.Name
strSubformcontrol = "varform"
strControlname = "frmhistory"
strChildFields = "tabTripHeaderID"
strMasterFields = "tabTripHeaderID"
strRecordsource = "qryTrip"

Call MainFormLoaded(Me.Form.Name)

If MainFormLoad = True Then

Call displayVarform(strmainform, strSubformcontrol, strControlname,
strChildFields, strMasterFields, strRecordsource)
Call bindvarform(strmainform, strSubformcontrol)

Else

strChildFields = ""
strMasterFields = ""
strRecordsource = ""

Call displayVarform(strmainform, strSubformcontrol, strControlname,
strChildFields, strMasterFields, strRecordsource)
Call unboundvarform(strmainform, strSubformcontrol)

End If

Call CalcTotalWeight(strmainform, strSubformcontrol)

'Call varFormEdit(strMainForm, strSubformControl, strControlName, frmState)
'Forms(strMainForm)(strSubformControl).AllowAdditions = False
End Sub
 
R

Rick Brandt

Cynd said:
I created a form with a subform that shows the related records. For
all 7 main categories there is a list of items which show up
alphabetized by level and title. The data was entered in the table
sorted by level and alphabetized by title. When I pull up any of the
categories except one the data shows correctly. In the one category,
for one level only, the data has records out of order. The first 15
or so records do not show up until after the 30th record. All of the
records are in order up to that point, and including the 15 that are
out of sync. I cannot determine any reason behind the problem. Does
anyone know why this is happening and how I can fix it?

Use a query for the subform instead of the table and sort that query as desired.
All it needs to be is a simple...

SELECT *
FROM TableName
ORDER BY FieldName1, FieldName2, etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top