Re: Combo box to define what column to order by my subform
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Thu, 6 Dec 2007 21:33:45 +0900
Assign the value of the combo to the OrderBy property of the form in your subform, and then turn on its OrderByOn property.
You need to see if the user did select something in the combo.
You also need to add square brackets, since some of your field names contains spaces.
This kind of thing:
Private Sub combosort_AfterUpdate()
With Me.[48_form_Visualiza_Processos subform].Form
If IsNull(Me.combosort) Then
.OrderByOn = False
Else
.OrderBy = "[" & me.combosort.value & "]"
.OrderByOn = True
End If
End With
End Sub
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Marco" <Marco@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2D2A6AD1-F60A-4D83-BA4C-551F57DB3437@xxxxxxxxxxxxxxxx
Hi. In my form I want to creat a combo box to allow the way that I want to
order my sub form.
the combo will have the options:
- Process no.
- Employee number
- Name
- Date
I want, that my subform will be sort/order brom the opionthat I'll choose on
the combobox.
there's an option on subform that is order by, but I can't reach it from the
code.
I tried:
Me.[48_form_Visualiza_Processos subform].Form.OrderBy me.combosort.value
but it say's "invalid use of property".
How can I solve my problem?
regards,
Marco
.
- Follow-Ups:
- Prev by Date: Re: a shadow in the very left row when we put the cursor on the row
- Next by Date: Re: Combo box to define what column to order by my subform
- Previous by thread: a shadow in the very left row when we put the cursor on the row
- Next by thread: Re: Combo box to define what column to order by my subform
- Index(es):
Relevant Pages
|