R
RMTechie
When a form loads, I want to set the subform's sort order based on the
value of a text box on the parent form.
For instance, if the field txtGender on my parent form, "frm_Parent",
is "MALE" then I want to set the sort order of the subform,
frm_Parent_Subform, to SortOrderMale and otherwise (Else?) to
SortOrderOther.
So, when frm_Parent opens, I want it to sort the subform based on
whether or not txtGender is "MALE"
I had this is in the subform's Open event but couldn't get it to work:
If Forms![frm_Parent].[txtGender] = "MALE" Then
Me.OrderBy = "SortOrderMale"
Else
Me.OrderBy = "SortOrderOther"
End If
I'm also unsure which event to place such a thing in, whether in the
Form or Subform, Open or Load, etc.
I'd appreciate help! Thanks!
value of a text box on the parent form.
For instance, if the field txtGender on my parent form, "frm_Parent",
is "MALE" then I want to set the sort order of the subform,
frm_Parent_Subform, to SortOrderMale and otherwise (Else?) to
SortOrderOther.
So, when frm_Parent opens, I want it to sort the subform based on
whether or not txtGender is "MALE"
I had this is in the subform's Open event but couldn't get it to work:
If Forms![frm_Parent].[txtGender] = "MALE" Then
Me.OrderBy = "SortOrderMale"
Else
Me.OrderBy = "SortOrderOther"
End If
I'm also unsure which event to place such a thing in, whether in the
Form or Subform, Open or Load, etc.
I'd appreciate help! Thanks!