Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does this message mean?

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
0
0
Hi my friends:
I am trying to run a program copied from "ACCESS VBA 2000 HANDBOOK". It gave me the message "The expression you entered has a function name that microsoft access can't find". The function was written in Form's module, and two toggle controls will refer the function name.

Your help will be highly appreciated.

Haijun
 
You need to paste the code- all of it then people can see exactly what the problem is. My guess is taht you have pasted in one function but it calls for another function you have not added in. What does the debug window show you?
 
I put the code first in my form's module, it did not work. Then I put it in my module, it still did not work. I put "=setorderby()" in the click event box for two toggle buttons: one customer, another employee. When I click the toggle button. The error message appeared. I also follow other suggestion to delete the missing link in reference. Still did not work. Please see my code below. Thank you for your help.

Haijun

Public Sub SetOrderBy()
Const conCustomers = "Customers_CompanyName"
Const conEmployees = "LastName"

Dim strSortCustomers As String
Dim strSortEmployees As String
Dim strSort As String

Select Case tglCustomer.Value
Case True
strSortCustomers = conCustomers & " DESC"
Case False
strSortCustomers = False
Case Else
strSortCustomers = conCustomers
End Select

Select Case tglEmployee.Value
Case True
strSortEmployees = conEmployees & " DESC"
Case False
strSortEmployees = False
Case Else
strSortEmplotees = conEmployees
End Select

If strSortCustomers = "" Then
If strSortEmployees = "" Then
strSort = ""
Else
strSort = strSortEmployees
End If
Else
If strSortEmployees = "" Then
strSort = strSortCustomers
Else
strSort = strSortCustomers & ", " & strSortEmployees
End If
End If

If strSort = "" Then
Me.OrderByOn = False
Else
Me.OrderBy = strSort
Me.OrderByOn = True
End If

End Sub


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top