Hi, Hope someone can help me.
I have the following setup in an Access database
A master form 'Customers'
in 'Single Form' view
that has a RecordSource of 'myCustomerTable'
CustomerCode
CustomerName
A subform 'Items'
in 'Datasheet' view
that has a RecordSource of 'myItems'
ItemCode
Qty
CustomerCode
There are no automatic 'Links' set up between the forms, but the 'On
Current' event of the 'Items' form contains the following code:
Form_Customers.Filter = "CustomerCode = " & Me.CustomerCode
Me.FilterOn = True
This works, and causes the Customers form to keep in sync with the
currently selected record in the Items grid. (And yes I know this is a
bit back to front, but please trust me that there are good reasons for
this...)
Given the above, my problem is this. All works fine, unless I try to
change the order of the items form (either by right clicking on the
top of the columns, or by using the OrderBy property of the form) as
soon as I apply the filter on the customers table, I can no longer
move the cursor down the Items form, it is fixed at the top. Also the
order of the Items table reverts to what it was (OrderByOn on the
Items form gets reset to false by the FilterOn on the Customer form).
Can anyone tell me why this happens, and how I can stop it?
This all sounds really complicated, but is actually quite straight
forwards if you try and reproduce it!