Z
Zalthu
I have populated a list box from a query and have two buttons with code to
sort either by LastName or MembershipNumber. It works fine on my PC where I
developed it. A membership Number would typically be XX_001 or YYY_002 and I
want it to sort on the numerical value
Code which doesn't work: Me.lbMembers.RowSource = "SELECT [ID], [LastName],
[Firstname], [MembershipNo] FROM tblMembers ORDER BY
Right([MembershipNo],3);"
Code which runs OK: Me.lbMembers.RowSource = "SELECT [ID], [LastName],
[Firstname], [MembershipNo] FROM tblMembers ORDER BY [LastName];"
It won't work on my laptop. It just empties the ListBox and doesn't throw an
error. It restores the data when I run the 'SortByLastName' button I tried
to debug it on the laptop and tried to look at the help file but it said it
wasn't installed on this machine. This set me thinking. If I do the VBA on
my machine, will it not run on other machines where the user has installed
the basic, out of the box, Access.
I suspect it is not recognising the function 'Right'. I have exactly the
same references available on both machines.
Any ideas?
sort either by LastName or MembershipNumber. It works fine on my PC where I
developed it. A membership Number would typically be XX_001 or YYY_002 and I
want it to sort on the numerical value
Code which doesn't work: Me.lbMembers.RowSource = "SELECT [ID], [LastName],
[Firstname], [MembershipNo] FROM tblMembers ORDER BY
Right([MembershipNo],3);"
Code which runs OK: Me.lbMembers.RowSource = "SELECT [ID], [LastName],
[Firstname], [MembershipNo] FROM tblMembers ORDER BY [LastName];"
It won't work on my laptop. It just empties the ListBox and doesn't throw an
error. It restores the data when I run the 'SortByLastName' button I tried
to debug it on the laptop and tried to look at the help file but it said it
wasn't installed on this machine. This set me thinking. If I do the VBA on
my machine, will it not run on other machines where the user has installed
the basic, out of the box, Access.
I suspect it is not recognising the function 'Right'. I have exactly the
same references available on both machines.
Any ideas?