Solved

Execute Module in Access Application

Posted on 2011-09-20
7
375 Views
Last Modified: 2012-05-12
I have a module named

Public Function DeleteDuplicates()

How do I get this to run in my application?
0
Comment
Question by:mato01
  • 3
  • 2
  • 2
7 Comments
 
LVL 75
ID: 36569207
One way ... in your code from where ever

Call DeleteDuplicates()

mx
0
 
LVL 75
ID: 36569213
And actually, just to keep the terminology straight, you have a Function in a Module.  Modules don't run or execute.  Functions (and Subs) do.

mx
0
 

Author Comment

by:mato01
ID: 36569314
Thanks for setting me straight on the terminology.

Ok. I placed Call DeleteDuplicates() behind a button. And, even though it does delete, it gives me the following error.

Run-time error '3167:  Record is deleted.

Also, can I run this from a Macro?

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 125 total points
ID: 36569354
"Run-time error '3167:  Record is deleted."

Well ... that's really a different Question.  Close this Q and start a new Q ... posting the Code you have.

Macro ...yes - see image.

mx



Capture1.gif
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36569993
<No Points wanted>

<And actually, just to keep the terminology straight>
...and a bit more.

Your public function must be in a standalone "Module" (not just in the code for a form or Report), in order to be called from a Macro.

Many people think that simply by making a function "Public" will make it accessible to a macro.

If a function is public, yes, it can be called from anywhere using "code"

But in order to be seen by a macro, it also has to be in a standalone module.

Again, just FYI, for clarity.

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36570008
But in order to be seen by a macro, it also has to be in a standalone module.
sb
But in order to be seen by a macro, the function also has to be in a standalone module and be Public
0
 

Author Closing Comment

by:mato01
ID: 36570968
Thanks.  Went online for additional help. Once I compact and repaired the database everything was fine and the macro ran.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question