I have a continuous form that has a table as its record source but I would like to set up
a combo box on my main form to sort the table by part number, by quantity or by line number...
Here is what the query that sorts the table by Part number looks like:
(I have omitted the other two queries)
but it only displays the table when I use the following:
How do I get it to actually sort and update the table?
Thanks
a combo box on my main form to sort the table by part number, by quantity or by line number...
Here is what the query that sorts the table by Part number looks like:
(I have omitted the other two queries)
Code:
SELECT * FROM PC_frm_tbl ORDER BY PC_frm_tbl.[Part_No];
but it only displays the table when I use the following:
Code:
Dim str1 As String
Dim qry As String
DoCmd.SetWarnings False ' squelch all update table qry messages
str1 = Me.Comb
If str1 = "By Quantity" Then
qry = "SortPCbyQty_qry"
DoCmd.OpenQuery qry, acViewNormal, acReadOnly
End If
If str1 = "By Part_Num" Then
qry = "SortPCbyPart_qry"
DoCmd.OpenQuery qry, acViewNormal, acReadOnly
End If
If str1 = "By Line #" Then
qry = "SortPCbyLine_qry"
DoCmd.OpenQuery qry, acViewNormal, acReadOnly
End If
PCList_frm.Requery
DoCmd.SetWarnings True ' unsquelch all update table qry messages
How do I get it to actually sort and update the table?
Thanks