Discussion Locked

Access 2000 VBA Question

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a report and I want to set several Form Properties. I can set all of the properties EXCEPT Orderby See my code below:

Me.Label6.Caption = "New Clients-Holocaust Survivors (Numerical)"
'Me.OrderBy [CLIENT_ID]
'Me.OrderBy = "[CLIENT_ID]"
Me.OrderByOn = True

What am I doing wrong???

Thanks,
Alan

3 replies

by timfox

Me.Label6.Caption = "New Clients-Holocaust Survivors (Numerical)"
Me.OrderBy = "CLIENT_ID"
Me.OrderByOn = True

What you're actually doing is applying a string expression/value to the OrderBy property of the report's OrderBy property - which is the name of the value (not the text box) that is being ordered.
You could also use:
Me.OrderBy = "CLIENT_ID ASC" (defaulted to ascending anyway)
or
Me.OrderBy = "CLIENT_ID DESC"

This discussion is closed to new replies.