newbie need help on parm passing

G

Guest

Hi - I am trying to access the results of a function that checks to see if an
object exists: I downloaded it from
http://www.mvps.org/access/modules/mdl0014.htm
It works great of course, but I'm not sure how to retrieve the results from
within my module. I tried something like this:

Call ObjectExists("Table", "TrayLabels")

If ObjectExists = True Then
DoCmd.DeleteObject acTable, strImportTableName
End If

but it didn't seem to like it.
The code for the function ObjectExists is:

Function ObjectExists(strObjectType As String, strObjectName As String) As
Boolean

(etc.) and if I debug this, I can see that the correct results for
ObjectExists, but I don't know how to access that from my module.
Can anyone tell me what I'm missing? Thank you.
 
B

Brendan Reynolds

SomeBooleanVariable = ObjectExists("Table", "TrayLabels")
If SomeBooleanVariable = True Then ...

Or, more concisely ..

If ObjectExists("Table", "TrayLabels") Then ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top