1)The form in question consists of a parent form with a list box, and a sub form that is a multi-record form. The selected entry in the list box controls the detail displayed in the sub form. 2)This code example is from the Form_Open sub procedure of the sub form. 3)Now open the parent form. 4)This is just a piece, but on the full form the results are entirely different if you turn on OrderBy and if you dont turn it on. If I turn it on, I get nothing in the sub form. If I leave it off things work perfectly. This is not terribly import as I can get around it. But it is an question. And, for the record, I dont use orderBy very often, usually use an sql statement.
Private Sub Form_Open(Cancel As Integer) 'Me.filter = "Country = 'USA'" 'Me.FilterOn = True 'Me.FilterOnLoad = True Me.OrderBy = "Date, transaction_type, ID" Me.OrderByOn = False Me.OrderByOnLoad = False If (Me.OrderByOn) Or (Me.OrderByOnLoad) Then Me.recordSource = "Finances_Transactions" Else Dim sqlStmt: sqlStmt = "SELECT * FROM Finances_Transactions ORDER BY <>;" sqlStmt = Replace(sqlStmt, "<>", Me.OrderBy) Me.recordSource = sqlStmt End If End Sub
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.