Call Function

How can I call the Function in the attached database?
db26.zip
leezacAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Are you referring to:

Private Sub Command0_Click()
Call SearchOrReplace
End Sub

?

If so, you need to pass the two non-optional variables

Private Sub Command0_Click()
    Call SearchOrReplace ("SomeModuleName","SomeStringToFind")
End Sub

But you have other issues in the Function first ... it does not compile.  You need to resolve this first ...

1
0
 
Bill RossCommented:
Hi,

In vba you "call" a subroutine like this:

call MySub

In vba you execute a function like this:
Dim vReturnValue
vReturnValue = MyFunction()

In general subs do work and functions return values.

Regards,

Bill
0
 
leezacAuthor Commented:
I am not sure how to do in module. Can you add to the attached database and send back.  

I need to see how to apply to the code in the attached database.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
leezacAuthor Commented:
I changed the Dim statement -

Dim mdl As Module
   
    Set mdl = Modules(ModuleName)
 
Please see attached database.   I added call on On Click on form, but still does not work....
db26.zip
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
What is the intent of this code ?
What is it supposed to be doing ?

Did you write this code or get it from somewhere else ?


mx
0
 
leezacAuthor Commented:
LSM was helping me on another post: http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27831808.html

but I can't get to work.

I am needing to be able to search MSAccess Databases on O;/ for VBA in modules and forms to find a string.  I do not need to replace right now - just be able to do search.

If I could also show the string somehow in a table or on form like in the attached.

The example of a database I found is attached, but it searches tables and you have to import into each database.
dbSearchAll.zip
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Are you able to get LSM to respond ... and help with this ?

mx
0
 
leezacAuthor Commented:
Not yet.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.