Hi,
I am at a loss. I have an Access 2003 database with a macro that calls a public function during the autoexec start up. This has been working fine in several databases that are .mde files. I have one that is not cooperating. I have added a couple of forms 2 tables, some queries and a report to this database, but nothing connect to the macro. When I try to open the .mde I get the message "the expression you entered has a function name that microsoft access can't find" and a button to click Ok. You must hit OK twice then you get the Action Failed dialog box that says this is error number 2950. I have check to make sure it is in a trusted location, the references are all there and even imported everything to a new database and still I get message. I am at a lose to solve this.
The macro and function were set up by someone else and I have inherited this database from them. If this is not the correct forum, let me know and I will re-post.
The action failed dialog box has:
Macro Name:
NASAsearch2
Condition:
True
ActionName:
RunCode
Argumetns:
ClrTable("NASAsearch")
Error Number:
2950
The code it blows up on is:
Public Function ClrTable(TName As String) As String
Dim db As DAO.Database
Dim wrs1 As DAO.Recordset
Set db = CurrentDb
Set wrs1 = db.OpenRecordset(TName, dbOpenDynaset)
Do Until wrs1.EOF
wrs1.Delete
wrs1.MoveNext
Loop
wrs1.close
Set wrs1 = Nothing
Set db = Nothing
ClrTable = "Table " & TName & " cleared! " & Time()
End Function
The rest of the macro repopulates the table after testing to see what type of user is signing in so it can open the correct form.
Thanks for your help
I am at a loss. I have an Access 2003 database with a macro that calls a public function during the autoexec start up. This has been working fine in several databases that are .mde files. I have one that is not cooperating. I have added a couple of forms 2 tables, some queries and a report to this database, but nothing connect to the macro. When I try to open the .mde I get the message "the expression you entered has a function name that microsoft access can't find" and a button to click Ok. You must hit OK twice then you get the Action Failed dialog box that says this is error number 2950. I have check to make sure it is in a trusted location, the references are all there and even imported everything to a new database and still I get message. I am at a lose to solve this.
The macro and function were set up by someone else and I have inherited this database from them. If this is not the correct forum, let me know and I will re-post.
The action failed dialog box has:
Macro Name:
NASAsearch2
Condition:
True
ActionName:
RunCode
Argumetns:
ClrTable("NASAsearch")
Error Number:
2950
The code it blows up on is:
Public Function ClrTable(TName As String) As String
Dim db As DAO.Database
Dim wrs1 As DAO.Recordset
Set db = CurrentDb
Set wrs1 = db.OpenRecordset(TName, dbOpenDynaset)
Do Until wrs1.EOF
wrs1.Delete
wrs1.MoveNext
Loop
wrs1.close
Set wrs1 = Nothing
Set db = Nothing
ClrTable = "Table " & TName & " cleared! " & Time()
End Function
The rest of the macro repopulates the table after testing to see what type of user is signing in so it can open the correct form.
Thanks for your help