• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

Call Function

How can I call the Function in the attached database?
db26.zip
0
leezac
Asked:
leezac
  • 4
  • 3
1 Solution
 
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 MVP, Access and Data Platform)Commented:
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 MVP, Access and Data Platform)Commented:
Are you able to get LSM to respond ... and help with this ?

mx
0
 
leezacAuthor Commented:
Not yet.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now