Log in

View Full Version : Solved: Subform will not sort?



Jacob Hilderbrand
05-08-2006, 08:42 PM
I am not sure why the subform will not sort properly. I tried changing the Order By property several times, but must be missing something.

I noticed that when I added a new row of data, regardless of the data entered, when I load the form again, that entry will be at the top of all the rows of data. It should be sorted by the date field.

I would appreciate any help in figuring out what I am missing in the attachment.

Thanks

geekgirlau
05-08-2006, 09:32 PM
You can either sort it by code (see below) or change the data source for the subform to a query that specifically sorts the data.

Private Sub Form_Load()
With Me.TblInvoice_Subform.Form
.OrderBy = "[TblInvoice].[Date]"
.OrderByOn = True
End With
End Sub

Jacob Hilderbrand
05-08-2006, 09:40 PM
That seems to do the trick. Thanks :)