Hi guys i have figured out where the error lies but i dont know how to fix it.
When the first run of PrintRoutine is completed it retains the Original Case. I am trying to figure out how to get the routine to "reset" and on the .MoveNext select a new case as the ReportType field will be...
Hi Guys
I think i have figured it out.
I can remove the loop easily enough but i need to tell the routine to re query each time.
Please tell me if i am wrong
Allan
Hi BHD,
I have attached the snip of the message box output. I placed the code right where you showed me to place it.
It has picked the right Template for the Data but then it retains the same Template for the other "Reports" as well.
Hence the question about the loop.
Thanks for the help...
Hi Guys
@Mark to be honest Mark no i dont I am only getting back into access since 97 and i have forgotten a whole heap of things and trying to relearn on the fly is no fun.
I will make the changes and test it :)
Thanks Guys
Allan
Hi BHD
I have had a look through all the information that you have pointed me to and i cant make heads or tails out of it. I must admit that this project has become far more involved than what was originally discussed with the client.
To that end I am getting stuck on the Print Report code...
Hi BHD
Sorry for the late reply.
After much testing i have it semi working with teh data being transferred across.
How do i get the reports to actually show the actual data of the cell instead of the ID?
For example The Project field is supposed to say Test Brisbane but instead it shows as...
Hi guys
Just an update:
I have got it working and running the code and saving the file. At the moment it is saving to the documents directory (I will need to change that to save in a different location)
The interesting thing is that it is not transfering the information to the document.
Any...
Hi BHD
How would i change the Combo box to a Text box and make sure that it only displays the Report Type field requested?
The form is based straight off a query called qryReports
Thanks for your help
Allan
Hi Big
The names for the bookmarks are already set to the names listed in the code.
This has gotten way bigger than i have ever intended it to be
Allan
Hi Guys
I have worked it out to a point. Here is the revised code that is working.
Option Compare Database
Option Explicit
Public Sub PrintReport(ReportType As String)
Dim wApp As Word.Application
Dim wDoc As Word.Document
Dim fn As String
Select Case ReportType...
Hi Guys
I have been playing and created a button with the following code:
Sub RetriveFolder()
Dim myfolder As String
Dim Fldr As String
myfolder = "C:\QA\Templates\"
Fldr = Dir(myfolder, vbDirectory)
If Len(Fldr) > 0 Then
MsgBox (Fldr & " Already Exists")...
Hi Guys
This is a snip from the the code that is msgbox section.
I am so sorry for being so dumb in vba (it has been a very long time since i have done anything with access vba)
Thanks for all your help. I really appreciate it
Allan
Hi Guys
I have put the msgbox code back into the routine above the line that was erroring out on:
fn = Environ("SystemDrive") & "\QA\Templates\"
Set wApp = New Word.Application
MsgBox "Directory:" & fn
Set wDoc = wApp.Documents.Open(fn)
When it runs it pops up a message box...