Parameters-Macro-SetWarnings Off (1 Viewer)

vbjohn

Registered User.
Local time
Today, 11:55
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-
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 12:55
Joined
Dec 26, 2002
Messages
4,748
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
 

vbjohn

Registered User.
Local time
Today, 11:55
Joined
Mar 22, 2002
Messages
75
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-
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 12:55
Joined
Dec 26, 2002
Messages
4,748
Is that the macro code? What does it ask for the parameter?
 

vbjohn

Registered User.
Local time
Today, 11:55
Joined
Mar 22, 2002
Messages
75
Actually this is the Visual Basic code. I also tried it in VBA. I am just stummped.


John-
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 12:55
Joined
Dec 26, 2002
Messages
4,748
Am I correct in assuming the parameter that it asks for is a field on the report?
 

vbjohn

Registered User.
Local time
Today, 11:55
Joined
Mar 22, 2002
Messages
75
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-
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 12:55
Joined
Dec 26, 2002
Messages
4,748
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.
 

vbjohn

Registered User.
Local time
Today, 11:55
Joined
Mar 22, 2002
Messages
75
Here are the screen shots. Please ask any other questions.


John-
 

Attachments

  • vbaapp.zip
    40.3 KB · Views: 107

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 12:55
Joined
Dec 26, 2002
Messages
4,748
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
 

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 12:55
Joined
Dec 26, 2002
Messages
4,748
Do you still want the parameter to pop up and be asked for?
 

Users who are viewing this thread

Top Bottom