Query

When i put this lines i got runtime error 2486. err.desc you cannot carry this action at the present time
Code:
Private Sub Command6_Click()
Dim access As New access.Application
access.DoCmd.OpenReport "MR", acViewPreview
End Sub
 
Last edited:
i got runtime error 2486. you cannot carry out this action at the present time.
Code:
Private Sub Command6_Click()
Dim access As New access.Application
access.DoCmd.OpenReport "MR", acViewNormal
End Sub
 
i got runtime error 2486. you cannot carry out this action at the present time.
Code:
Private Sub Command6_Click()
Dim access As New access.Application
access.DoCmd.OpenReport "MR", acViewNormal
End Sub

Maybe this (you'll need the path to the MDB file)

Dim access As New access.Application
access.OpenCurrentDatabase(strPathToDB)
access.DoCmd.OpenReport "MR", acViewNormal
 
sir ,
since i will show only MR report but database is comming in normal mode.
Kindly help me.
Code:
Private Sub Command6_Click()
Dim Access As New Access.Application
Access.OpenCurrentDatabase ("[URL="file://\\asfserver\itp$\Product_tabletest.mdb"]\\asfserver\itp$\Product_tabletest.mdb[/URL]")
Access.DoCmd.OpenReport "MR", acViewNormal
End Sub
 
Hm....That's a tough one. Access always opens as a parent window, as far as I know, and then shows its forms and reports in child windows. I don't think you can eliminate the parent window. Probably the best you can do is hide things you don't want the user to see. I believe there are ways to hide things using code, but I don't how to do it (no samples in my notebook). Maybe do a search on this forum for hiding menus, toolbars, tables, and such.

By the way VB6 has a reporting tool similar to Access (but proabably not as full-featured). That would solve the problem I suppose. I can give you some sample code for that if you like, because I tried it once.
 
I just thought of another possible solution. Maybe Access can save the report to a Word document or HTML file. then close Access. Then use Shell to open the document. I'll get you some sample code.
 
how Access save report to word document.kindly help me please and send sample code ?
 
DoCmd.OutputTo acOutputReport, "Report1", acFormatRTF, "c:\Report1.rtf"
Application.CloseCurrentDatabase
Shell "RUNDLL32.EXE URL.DLL,FileProtocolHandler " & "C:\Report1.Rtf", vbMaximizedFocus
 
Now I'm wondering if this would have worked:

Access.Visible = false
 
sir when i put these codes access is comming i want only report
when i click on the button only access report should come.
Code:
Private Sub Command6_Click()
Dim Access As New Access.Application
Access.OpenCurrentDatabase ("[URL="file://\\asfserver\itp$\Product_tabletest.mdb"]\\asfserver\itp$\Product_tabletest.mdb[/URL]")
'Access.DoCmd.OpenReport "MR", acViewNormal
DoCmd.OutputTo acOutputReport, "MR", acFormatRTF, "c:\Report1.rtf"
Application.CloseCurrentDatabase
Access.Visible = False
Shell "RUNDLL32.EXE URL.DLL,FileProtocolHandler " & "C:\Report1.rtf", vbMaximizedFocus
End Sub
 

Attachments

This code worked for me (but it won't work for you).

Dim Access As New Access.Application
Access.OpenCurrentDatabase ("C:\Northwind.mdb")
DoCmd.OutputTo acOutputReport, "Products By Category", acFormatHTML, "c:\Report1.html"
Application.CloseCurrentDatabase
Shell "RUNDLL32.EXE URL.DLL,FileProtocolHandler " & "C:\Report1.html", vbMaximizedFocus
Access.Quit
Set Access = Nothing

It won't work for you because you're getting a security warning. You can either set the security to Low (which is no security against macro viruses) at Tools > Macros > Security or you can create a digital signature to sign the code. You would probably have to install the certificate on each user's machine. Or, purchase a retail certificate in which case you probably won't have to install it on each user's machine.

Some people operate on Low security because they rely on Norton Antivirus to take care of macro viruses.
 
yes sir i got security warning .if you don't mind can you tell me any aditional way to solve this issue. since we cannot install security
certificate for all pc there are 50 pcs here in.
[
Private Sub Command6_Click()
Dim Access As New Access.Application
Access.OpenCurrentDatabase ("\\asfserver\itp$\Product_tabletest.mdb")
'Access.DoCmd.OpenReport "MR", acViewNormal
DoCmd.OutputTo acOutputReport, "MR", acFormatHTML, "c:\Report1.html"
Application.CloseCurrentDatabase
Shell "RUNDLL32.EXE URL.DLL,FileProtocolHandler " & "C:\Report1.html", vbMaximizedFocus
Access.Quit
Set Access = Nothing
End Sub
[/code]
 
I don't know another way. Either set security to Low or purchase a retail certificate. A retail certificate doesn't have to be installed on every machine.

Really, I don't understand your network setup. Go ahead and try a free certificate and see if it solves the problem. If not, you'll have to purchase one.

Sorry I don't know any other solutions.

Again, VB6 has a free reporting tool add-in. You could use that instead.
Other options
- Write manually to Excel.
- Write manually to a textfile (i.e. dont use Ms Access Reporting), i created a decent report this ways
- Write manually to a Word document using the Courier New Font (this font will keep columns aligned).
- Write manually to a HTML file using cells to keep columns aligned.
- Use Crystal if you have it.
 
Have you tried converting to an MDE file? I don't know if that sort of file gives security warnings.
 
can you tell me how should i use self join in Ms access using sql view
i got syntax error when i tried ?
Code:
Select distinct row  m.* from mr m  inner join mr r on m.req_no=r.req_no
 

Users who are viewing this thread

Back
Top Bottom