Galisteo8
asked on
Subform's OrderBy is being ignored
Working with Access 2000 front-end and SQL Server 2000 back-end...
I have a subform that is resistant to ordering its records by a certain value. Please read on.
I have a view (qryBrandLots) which combines data from two different tables (LOT and AUCTION). By default the results are ordered by a value called LotNum, which comes from the LOT table.
qryBrandLots is the record source for a datasheet form (DataForm). DataForm's OrderBy property is set to qryBrandLots.LotNum, and the Unique Table property is set to LOT. DataForm is itself used as a subform on another form (MainForm), and MainForm is opened from elsewhere by a command button with the following command in its OnClick event:
DoCmd.OpenForm stDocName, acNormal, , stFilter
When MainForm opens, the DataForm subform displays the properly filtered records, but they are NOT ordered by LotNum. Rather, they appear to be ordered by EbayNum -- which is the key value of the AUCTION table that's referenced in the underlying query.
I don't want to have to order the records in the subform AFTER it opens. How can I get it to pay attention to its own OrderBy property?
Thanks,
Galisteo8
I have a subform that is resistant to ordering its records by a certain value. Please read on.
I have a view (qryBrandLots) which combines data from two different tables (LOT and AUCTION). By default the results are ordered by a value called LotNum, which comes from the LOT table.
qryBrandLots is the record source for a datasheet form (DataForm). DataForm's OrderBy property is set to qryBrandLots.LotNum, and the Unique Table property is set to LOT. DataForm is itself used as a subform on another form (MainForm), and MainForm is opened from elsewhere by a command button with the following command in its OnClick event:
DoCmd.OpenForm stDocName, acNormal, , stFilter
When MainForm opens, the DataForm subform displays the properly filtered records, but they are NOT ordered by LotNum. Rather, they appear to be ordered by EbayNum -- which is the key value of the AUCTION table that's referenced in the underlying query.
I don't want to have to order the records in the subform AFTER it opens. How can I get it to pay attention to its own OrderBy property?
Thanks,
Galisteo8
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
BlueLizard,
I'll try your suggestion. Will post the query for perusal if that doesn't do the trick.
I'll try your suggestion. Will post the query for perusal if that doesn't do the trick.
ASKER
Thanks, that got it. Should have thought of that!
--Galisteo8
--Galisteo8
> I have a view (qryBrandLots) which combines data from two different
> tables (LOT and AUCTION). By default the results are ordered by a
> value called LotNum, which comes from the LOT table.
Does this query have the Order By statement in it? maybe you could post the query?
Bob