Refresh of subform after new sort order via orderby

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

on my main form, I have a subform which is not linked to the main form. The
record source points to a normal Access table, property orderbyon = true with
orderby statement containing one field as order criteria. I'm using Access
2000.

If I change the orderbyon to another value (e.g. ORDERBY = "col1, col2"),
the subform will not be refreshed even if I call me.subform.refresh or
me.subform.requery as stated in questions already.

Maybe I'm making an error in principle.
 
Set the OrderByOn to True after changing the OrderBy:

Example:
With Me.[Subform1].Form
.OrderBy = "col1, col2"
.OrderByOn = True
End With

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
That's what I did already but the refresh is not working. I see that Access
is very sensible if you fire too many refreshs. The control will not always
be refreshed...

Allen Browne said:
Set the OrderByOn to True after changing the OrderBy:

Example:
With Me.[Subform1].Form
.OrderBy = "col1, col2"
.OrderByOn = True
End With

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
on my main form, I have a subform which is not linked to the main form.
The
record source points to a normal Access table, property orderbyon = true
with
orderby statement containing one field as order criteria. I'm using Access
2000.

If I change the orderbyon to another value (e.g. ORDERBY = "col1, col2"),
the subform will not be refreshed even if I call me.subform.refresh or
me.subform.requery as stated in questions already.

Maybe I'm making an error in principle.
 
What refresh?
There is no .Refresh in the suggested code.

Access will have save the record before the reordering can be applied. You
could do that by setting the Dirty property of the form to False.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
That's what I did already but the refresh is not working. I see that
Access
is very sensible if you fire too many refreshs. The control will not
always
be refreshed...

Allen Browne said:
Set the OrderByOn to True after changing the OrderBy:

Example:
With Me.[Subform1].Form
.OrderBy = "col1, col2"
.OrderByOn = True
End With


message
on my main form, I have a subform which is not linked to the main form.
The
record source points to a normal Access table, property orderbyon =
true
with
orderby statement containing one field as order criteria. I'm using
Access
2000.

If I change the orderbyon to another value (e.g. ORDERBY = "col1,
col2"),
the subform will not be refreshed even if I call me.subform.refresh or
me.subform.requery as stated in questions already.

Maybe I'm making an error in principle.
 
Back
Top