If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sorting Buttons (VBA)
I am struggling with creating commdand buttons for sorting on a field. Here
are the codes in the two buttons: ascending sort button... Me.OrderBy = "[Vendor_JE]" Me.OrderByOn = True descending sort button... Me.OrderBy = "[Vendor_JE]Desc" Me.OrderByOn = True The ascending button seems to work. My question is why isn't the descending button working and how to do clear out the OrderBy in the forms property. Thanks! -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Sorting Buttons (VBA)
szag -
Put a space between the fieldname and Desc: Me.OrderBy = "[Vendor_JE] Desc" -- Daryl S "szag via AccessMonster.com" wrote: I am struggling with creating commdand buttons for sorting on a field. Here are the codes in the two buttons: ascending sort button... Me.OrderBy = "[Vendor_JE]" Me.OrderByOn = True descending sort button... Me.OrderBy = "[Vendor_JE]Desc" Me.OrderByOn = True The ascending button seems to work. My question is why isn't the descending button working and how to do clear out the OrderBy in the forms property. Thanks! -- Message posted via http://www.accessmonster.com . |
#3
|
|||
|
|||
Sorting Buttons (VBA)
szag wrote:
I am struggling with creating commdand buttons for sorting on a field. Here are the codes in the two buttons: ascending sort button... Me.OrderBy = "[Vendor_JE]" Me.OrderByOn = True descending sort button... Me.OrderBy = "[Vendor_JE]Desc" Me.OrderByOn = True The ascending button seems to work. My question is why isn't the descending button working and how to do clear out the OrderBy in the forms property. Thanks! Is that a typo? Looks like you don't have a space between your sort field and the sort direction "[Vendor_JE] DESC" === extra spaces for clarity... -- Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
Sorting Buttons (VBA)
Perfect - Thanks.
Daryl S wrote: szag - Put a space between the fieldname and Desc: Me.OrderBy = "[Vendor_JE] Desc" I am struggling with creating commdand buttons for sorting on a field. Here are the codes in the two buttons: [quoted text clipped - 10 lines] button working and how to do clear out the OrderBy in the forms property. Thanks! -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|