C
Coleman
I have a two column form that I wish to allow the user to sort by a File's
Index number or by a File's Name. I have assigned a button to each column
and the following code to enable an ascending order on click:
Button #1 looks like this:
__________________________________________________
Private Sub Sort_By_File_Index_Click()
On Error GoTo Err_Sort_By_File_Index_Click
strFileIndex#.SetFocus
DoCmd.RunCommand acCmdSortAscending
Exit_Sort_By_File_Index_Click:
Exit Sub
Err_Sort_By_File_Index_Click:
MsgBox Err.Description
Resume Exit_Sort_By_File_Index_Click
End Sub
_________________________________________________
and Button #2 looks similarly like this:
_________________________________________________
Private Sub Sort_By_File_Name_Click()
On Error GoTo Err_Sort_By_File_Name_Click
strFileName.SetFocus
DoCmd.RunCommand acCmdSortAscending
Exit_Sort_By_File_Name_Click:
Exit Sub
Err_Sort_By_File_Name_Click:
MsgBox Err.Description
Resume Exit_Sort_By_File_Name_Click
End Sub
_______________________________________________
My problem is when I click on Button #1, I get "Complie Error: Invalid
Qualifier", yet Button #2 works fine....and YES, the control name
"strFileIndex#" is correct.
Any ideas???????
Thanks,
Coleman
Index number or by a File's Name. I have assigned a button to each column
and the following code to enable an ascending order on click:
Button #1 looks like this:
__________________________________________________
Private Sub Sort_By_File_Index_Click()
On Error GoTo Err_Sort_By_File_Index_Click
strFileIndex#.SetFocus
DoCmd.RunCommand acCmdSortAscending
Exit_Sort_By_File_Index_Click:
Exit Sub
Err_Sort_By_File_Index_Click:
MsgBox Err.Description
Resume Exit_Sort_By_File_Index_Click
End Sub
_________________________________________________
and Button #2 looks similarly like this:
_________________________________________________
Private Sub Sort_By_File_Name_Click()
On Error GoTo Err_Sort_By_File_Name_Click
strFileName.SetFocus
DoCmd.RunCommand acCmdSortAscending
Exit_Sort_By_File_Name_Click:
Exit Sub
Err_Sort_By_File_Name_Click:
MsgBox Err.Description
Resume Exit_Sort_By_File_Name_Click
End Sub
_______________________________________________
My problem is when I click on Button #1, I get "Complie Error: Invalid
Qualifier", yet Button #2 works fine....and YES, the control name
"strFileIndex#" is correct.
Any ideas???????
Thanks,
Coleman