Parameters-Macro-SetWarnings Off

vbjohn

Registered User.
Local time
Today, 07:09
Joined
Mar 22, 2002
Messages
75
In my visual basic application I am accessing my Access macro. I set the Warnings Off. But, there is this parameter that needs be to be passed. So when I run the macro, the parameter does not come up and errors occur. How do I over come this?


John-
 
Set the warnings to on until that parameter is entered, then turn them back off. Or you can make a text box with that parameter filled in already. These are a couple options for you.

Let me know if that helps!

Vassago
 
hmmm

then how do I pass a parameter to a macro? Cause the parameter is the 3rd message that gets poped up and then there is 2 more after that one.


Set appAccess = New Access.Application

appAccess.Visible = False
appAccess.OpenCurrentDatabase App.Path & "\VBAccess.mdb", True

With appAccess.DoCmd
.RunMacro "macRank"
.OpenReport "PerDiemRank", acViewPreview
.Maximize
End With

appAccess.Visible = True


John-
 
Is that the macro code? What does it ask for the parameter?
 
Actually this is the Visual Basic code. I also tried it in VBA. I am just stummped.


John-
 
Am I correct in assuming the parameter that it asks for is a field on the report?
 
Actually no it is not.

I created 1 query in the Queries section. Then I created another query that calls the first query then I create a Create Table query which call the 2nd query to enter in that data into the new table.

Does that make sense?

John-
 
Can you post a sample of what you have on here? It sounds a little more complicated than the details you first gave. If you can, I will look at it and see what can be done.
 
Here are the screen shots. Please ask any other questions.


John-
 

Attachments

Okay, in the VBA code, before the query is run that asks for the parameter, set the warnings back to on:

docmd.setwarnings true

Then after the query runs, set the warnings back off:

docmd.setwarnings false

Wouldn't this solve the problem? Let me know if it's not what you need.

Vassago
 
Do you still want the parameter to pop up and be asked for?
 

Users who are viewing this thread

Back
Top Bottom