|
-
Jan 19th, 2000, 07:47 PM
#1
Thread Starter
Lively Member
As I do to print a report done in Access that also receives parameters of a consultation from Access, if somebody can send an example I thank
all using vb , of course
------------------
The blessing of God enriches and it doesn't increase pains
-
Jan 19th, 2000, 09:10 PM
#2
Junior Member
Try this out. I am not exactly sure what you need but by creating a application object from inside of VB you can manipulate most any part of Access through VB. Here is a snipit of code that I use to change field objects inside Access via VB.
' Open up the report to determine what needs to be altered
Set oAccess = CreateObject("Access.Application.8")
oAccess.Visible = False
oAccess.OpenCurrentDatabase (strRepDbms)
oAccess.DoCmd.OpenReport "PSO VISIT SCHEDULE", acViewDesign
' Enumerate Reports collection
For Each rpt In oAccess.Application.Reports
' Search for the first date count field
For Each tbl In db.TableDefs
If tbl.Name = tableName Then
For x = tbl.Fields.Count - 1 To 0 Step -1
If InStr(tbl.Fields(x).Name, "/") <> 0 Then
' Update the LABELS of the report.
If blnSearchLabels Then
' Search for the field that needs changing on the report.
For y = rpt.Controls.Count - 1 To 0 Step -1
If (InStr(1, rpt.Controls(y).Name, "T_", vbTextCompare) <> 0 _
And InStr(1, rpt.Controls(y).Name, "/", vbTextCompare) <> 0) _
And InStr(1, rpt.Controls(y).Name, " Label") <> 0 _
And InStr(1, rpt.Controls(y).Name, " Sum") = 0 Then
"Field Found!rpt.Controls(" & y & ").Name:= " & rpt.Controls(y).Name
' Field found.
blnSearchLabels = False
Exit For
End If
Next y
End If
' Change the field labels for each month.
rpt.Controls(y).Caption = tbl.Fields(x).Name
rpt.Controls(y).Name = "T_" & tbl.Fields(x).Name & " Label"
By applying the same techniques as above you should be able to get to the report and do what you need to do. Best of luck.
-
Jan 19th, 2000, 09:20 PM
#3
Hmm.. it's looking good.. but does this mean you need to have access at your system?
Is just a question for Candu.
-
Jan 19th, 2000, 09:30 PM
#4
Addicted Member
-
Jan 19th, 2000, 09:43 PM
#5
Junior Member
Yes you must have access to your Access application; therefore, if the Access application is password protected you need to send the password to Access before you can open up the associated database.
------------------
[/b][/i]David L. Baudais[/i][/b]
Systems Analyst
-
Jan 19th, 2000, 10:16 PM
#6
Lively Member
Candu,
I think what you want in your signiture is David L. Baudais. *grin*
-
Jan 20th, 2000, 12:13 PM
#7
Junior Member
Are you sure, eh?
------------------
David L. Baudais
Systems Analyst
-
Jan 20th, 2000, 06:17 PM
#8
Thread Starter
Lively Member
The database is not with password, he has some reports that use consultations also done in ACCESS, THE PROBLEM is THAT THESE CONSULTATIONS HAVE PARAMETERS and I don't know as passing these parameters for the report through VB
I thank
------------------
The blessing of God enriches and it doesn't increase pains
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|