Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Print MS Access Report In VBA?


I created a report in MS access and fill it with new values in Visual Basic. However, I need it to print after that and I can't find anywhere how to do this?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Print An Access Report From Vb Witout Access
I have got my vb application to print an access 2000 report and this works fine, unfortunately when i compile the application to put on a machine without access it doesnt work

please help as the visual basic reporting isnt very good

cheers

Print Preview Access Report In Vb 6 Without Access
I 'd like to have a print preview of my access report. i know how to print but i can't display it without opening access. it has to be able on a system without access. i hope this is posible

this is the code to print it:

Private Sub Command1_Click()
Dim appAcc As Object

Set appAcc = GetObject("g:gip kilometervergoedingkilometervergoeding.mdb")

appAcc.DoCmd.OpenReport "adreskm"
End Sub

pc-er2920

VB App - Print Access Report
I have a VB 6 app that prints an MS Access report. The code works fine but the way it is right now, the database window shows and the user has to click print on the database window.
Is there another way to do this so the user doesn't have to see the Access window? I am using a parameter query since the user has to pick a report to print.
To me, it seems kind of a clunky way to do things.
I would appreciate any suggestions on how to do this better. I need to use an Access report so it will print out in the same way on each user's printer
Here is my code:
Dim appAccess As Object
Set appAccess = CreateObject("Access.Application")
Set appAccess = New Access.Application
On Error Resume Next
gDC.Close
appAccess.Visible = True
appAccess.OpenCurrentDatabase "\intranetdatabasesmmg.mdb", True
appAccess.DoCmd.Minimize
appAccess.DoCmd.OpenReport "Shipment", acPreview
Screen.MousePointer = vbHourglass
MsgBox "Report Printed"
Screen.MousePointer = Default
On Error Resume Next
appAccess.Quit
Set appAccess = Nothing

Any suggestions are welcomed

Print A MS Access Report In Vb
Hi,

How do you print a MS Access report from your vb application??

Print Access Report From VB
HI!

Does someone knows how to Print Access Report From VB without creating Access Objet?


Thanks!



Bye


JPIII

Print A Report In Access Using Vb
hi

I use access 2000 to create my reports. I have several reports in access.
When I click on a command butn in vb form I want to print the report in
access withought showing access. can I do that.

thanks

dhanuja



This email and any attachment hereto is for authorised use by the addressee
only. It may contain confidential or priviledged information and/or
proprietary material. If you are not the intended receipient , this email
and/or any information it contains should not be copied, disclosed,
retained or used by you or any other party, and the email and all its
contents should be promptly deleted fully from your system and the sender
informed. Thank you.

Print An Access Report Using VB
Hi all,

Is there away to print a report which I have created in Access using a command line in VB 6.0?

Possibly SQL or some other jazzy code?

Many Thanks

Tosh.

Print Access Report From Vb....
Hi all,
I am using vb6.0, access97
Note: Access mdb has work group file...
I am trying to print a report that is in database from form_command_Click()
Code:

If (ConnectiondbOpen(strUserName, strPassword) = True) Then
   DoCmd.OpenReport "Submission_Breakdown_Report", acViewNormal, , "[Submission_ID] =" & lArchiveSubId
   DoEvents
Else
End if

This works fine when the database window is open.
Code:
  Dim objaccess As New Access.Application
  dbname= "C:ss.mdb"
      With objaccess ...asks for login details
        .OpenCurrentDatabase filepath:=dbname
        .DoCmd.OpenReport reportname:=rptname, View:=0, ,"[Submission_ID] =" & lArchiveSubId
        DoEvents
        .CloseCurrentDatabase
      end With

When access file is closed and if i use the above code it is asking user id password to open database and
after entering still gives error...

Is there a way to print access report by passing work group info, so that it will not ask login details...?
Thanks in advance.




Edited by - sreddy on 6/12/2007 12:42:45 PM

Access 97 Print A Variable In A Report
I was wondering if it is possible to print the value of a variable in an access 97 report textbox?

I have a report that has code similar to the following:

----------------
Private Sub Report_Open(Cancel As Integer)
Dim varStr as String

If Forms!Main_frm!frameLine.Value = 0 then
varStr = "100"
else
varStr = "30"
End if
----------------

My question is can I print the value of the variable varStr in a textbox? I've tried adding code similar to the following:

------------------
Me.Textbox1.ControlSource = "='The variable value is ' & varStr"
------------------

I can get the text part to print ('The variable value is) but I can't seem to get the variable (varStr) value to print. I have noticed that I can print the variable value by way of a Msgbox...

-----------------
Msgbox "the value is " & varStr, vbOKCancel, "Tilte"
-----------------

I obviously don't understand something... can someone help me out?

Thanks

Problem Print Access Report
Help !!!

I am trying to print an Access report to a print file (PRN) which is easy to do using the print dialog box.
However I can find no way of doing this programatically.

Anyone got any ideas ?

Thanks

Anyone Know How To Get A VB Program To Print A Access Report?
Hey folks. First time poster here.


What I am trying to do is create a reciept for the current record in a Access table that the form is looking at. Well, I got it to make it into a report, but it opens the report, and I would rather it print it than open it.

Any suggestions?

Access Report Landscape Print
Hi,

I have several reports in Access and when I print them with my application, it prints with the default page layout.
How do I change the Page Layout with the Access object in my application to Landscape?

Lots of thanks!

OsMo

Print An Access Report From My Program
I have this program that needs to print a report of all what was done for the day. I keep all the data in a Access Database.

Is there a way to get Visual Basic to print the Report?

I just can find anything in the DAO 3.51 to help me.

Access Report Print Properties From VB...
Hello All,

I know how to run reports in an Access database from withibn VB.

What I can't figure out is how to modify the print properties.

Specifically the print margins.

For some reason, no matter how many times I set them to 0.25" they keep changing back to 1".

So, in the VB code that runs the thing, I want to lock down the margins each time the print is done.

Thanx In Advance,
->Noah

Print Access Database Report
I have a MS Access Database in my project that has a report name "ScubaNotes Dive Log" with fields such as "location", "AirTemp", "WaterTemp", and such. How can I print the report by clicking on my cmdPrint button on the form?

Thanx,
Anthony

Print Data Report With Rtf From Access
I have a report that is made using the data report (designer) in vb6. I have to fields in an Access table that contain rtf data. When I print these fields I get all the rtf tags.

How do you insert a field of rtf data into a data designer report?

Print Preview Using Access Report On VB
I saw this code in one of the threads. i tried it but it doesn't work perfectly. What I am trying to do is to print preview the report i have in Access. this code will only flickers or flash the report form in sec then gone. can somebody help me, what is wrong or why the report doens't stay to view?





visual basic code:--------------------------------------------------------------------------------
Public Sub RunAccessReport(strDB As String, strReport As String, _
Optional strFilter As String = "", Optional strWhere As String = "")
'===============================================================================================
Dim AccessDB As Access.Application

Set AccessDB = New Access.Application
AccessDB.OpenCurrentDatabase strDB
AccessDB.DoCmd.OpenReport strReport, acViewPreview, strFilter, strWhere
AccessDB.Visible = True
Set AccessDB = Nothing

End Sub

code above thanks to IROY55


thank you very much.

Print From Vb A Report Created In Access
how can I print from Vb a Report already set up and created in an Microsoft Acces database (version 2002)?

Print Or Priview A MS-ACCESS Report From The VB
Hi,

I have created a Report in MS-ACCESS. Now i have a command button in the VB, I need to activate this MS-ACCESS report when the command button is pressed.

Basically the MS ACCESS report previewed when ever that Print button is pressed in the VB.

Help me

Thanks,

How To Print MS Access 97 Report At Runtime
I would like to know how to print MS Access 97 reports from VB6 at runtime in code
and get to change the printer that is used, but not changing the default printer for Windows?

Access Print Report To Same Network Printer
Maybe this is too easy and I am trying to think too hard about this.

I have a report in access97 that automatically prints when the first person logs into my database on Monday. I am trying to setup the report so that it always prints to the same network printer no matter which individual logs in or from where. (They must be on the network to log in).

[Beenprinted] is just a check box in the forms underlying table that is used to make sure the report isn't printed twice on Monday. Here is the code that I want to add to so the report will always print to one particular network printer.


Code:
Private Sub Form_Load()
On Error GoTo Form_Load_Error

Dim Todaysdate As Integer
Todaysdate = DatePart("w", Now)

Select Case Todaysdate
Case 1
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 2
Dim stDocName As String

If Me![beenprinted].Value = False Then
stDocName = "rptContactBackNext7All"
DoCmd.OpenReport stDocName, acNormal
Me![beenprinted].Visible = True
Me![beenprinted].Value = True
Me![beenprinted].Visible = False
End If
Case 3
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 4
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 5
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 6
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
Case 7
If Me![beenprinted].Value = True Then
Me![beenprinted].Visible = True
Me![beenprinted].Value = False
Me![beenprinted].Visible = False
End If
End Select

Form_Load_Exit:
Exit Sub

Form_Load_Error:
MsgBox Err.Description
Resume Form_Load_Exit
End Sub
Thanks in advance!
FireDrake


"Nothing I say this day will teach me anything, so if I'm going to learn I have to do it by listening." -Larry King

Print Access Report To Visual Basic
Hello to everyone,

I'am a new user here in this forum. My quetion is
How can i print and access report to visual basic?
Can anyone teach me. what is the command should i use. I'am using Jet 3.5.
I've already tried some guideline and it seems that it didnt work for me. can anybody write a code so i can paste it to my program.
My MS Access database is located to drive Q:datacenter
igidmanila2003.mdb.

I would gladly appreciate your help.

Thank you,
Ronald

Print Access Report Multiple Times
Hi all,

I am using MS Access 2003 and VB6.
I have created an ADP and have a report that when opens uses an SQL statement to select the record source.

This part is working OK.
Dim sql As String
sql = "SELECT TOP 100 PERCENT Node, Date_from_charges_accrued, Date_to_charges_accrued, Call_type, Charge_amount, Number_of_calls, Cust_ref_number "
sql = sql & "FROM dbo.TblCallSummaryRecordC1 "
sql = sql & "WHERE Cust_ref_number = '" & OpenArgs & "'"
sql = sql & " ORDER BY Node"
Report.RecordSource = sql

The report gets run from inside a loop which is going through a customer table

Do 'loop untill end of rstforms
'run the reports.
DoCmd.OpenReport reportname, acViewPreview, , ,acWindowNormal, Custnum
rstForms.MoveNext
Loop Until rstForms.EOF = True

The problem is the report will only show the last customer in the customer table.

I have tried removing the acViewPreview part of the doCmd.openreport to send it straight to the printer, but it does not work.

What I am trying to do is display or print a report for each customer.

Any ideas? suggestions?

Disco Stu

Print Single Line Of Access Report?
I have the following code to print an Access report. It works, but I having trouble getting the "strWhere" to work properly. I am trying to get a field called "Left Amount" with the data "7.72 mg" in it to display. If I do not enter anything for "strWhere" then all my data shows. If I enter strWhere = "[Left Amount] = 7.72 mg" then no data shows up. What am I doing wrong?


VB Code:
PrintAccessReport READ_DB_2, READ_WRKGRP, "PreviousReadingsReport", Me.Caption, strWhere, False




VB Code:
Public Function PrintAccessReport(ByVal strDB As String, ByVal strWrkgrp As String, ByVal strReport As String, ByVal strCallingFormCaption As String, ByVal strWhere As String, preview As Boolean) As Boolean

Access 97 Report And Form Print Differently
Using Access 97, I have a form and a report.  There is text  in a memo field on the form.  I want the text to appear the same exact way on the report.  The problem is that when the text goes to the report, the word wrapping (and spacing) of the text changed.  If I were to print the form just from the form, the text appears the same as the report, not as it appears on the screen.  I want the screen fonts to be the same as the printer fonts.  I tried making the Layoutforprint property set to yes on both the form and report, but this does not change the problem.   

The weird thing is that using the font "Lucida Console", the form and report text spacing is identical.  However, for my company I have to use the font "Times New Roman."   When I use times new roman, the fonts do not line up (the spacing between letters changed between the form and report views causing the words to wrap around at different places with the forms and reports respectively).

The ultimate goal is that I have a report that has a narrative that must continue onto a second page.  In order for it to continue onto the second page automatically, I need the print and screen fonts to match.  Any help?

How To Print MS Access Report Using Visaul Basic
how to print one report it is already created in MS Access and i need to print that report using VB 6.0
 for database connection is ADO connection

Print Report From Access New Prob Ok Resolved
i have a report in access 2003 and would like to print it from vb6
is this possable
or do i have to open the database and print it from there
i see there is a datareport in vb6 can the reprt from access be imported to vb6
cheers
Doug


vb6 and access 2003
also newbie
may the force be with you

Edited by - dougvcd on 8/16/2005 4:52:33 AM

How Can I Print A Single Page In MS Access Data Report Using VB
Hello,

Can anyone put a code that when i click the print command It will launch a printer so i can select what page no. should i print.
Because as of now i am having a proble all page are printing and i cannot stop it.

I use a data and i 'am using access for my database.

Thanks,
Ronald

Detect Print Of Access Report From Preview Mode?
Is there a way to detect when a user has printed a report from Access 2002 when the report is in Preview mode? I need to do this from within Access. Thanks for any assistance.

How To Code A Vb Program To Print A Access 2002 Report
Whats an easy way to call a report in VB from Access 2002?  I need to call a report named "PayrollSchedule".  The program is written in VB6.0 and connected through a ADODC control to an Access 2002 database.  I have a command button designed to print the report with no code.  I need it to print by PayrollID.  Any help or suggestions would be greatly appreciated, thanks.

Print MS Access Report Form Visual Basic
Hi , please can you tell how i can print an MS ACCESS Report form visual
basic, i ned a sample code ..

Thanks

Need To Print An Access Report Via Visual Basic Application
I am in need of some help. My problem...I have a Visual Basic application connected to a SQL server database. I have to print a report that was built using Microsoft Access. The Access report has text fields bound to the SQL server Database.
When I print the report through Access everything prints however, when I print the report via my Visual Basic the text fields that were bound to the SQL database do not print. I have tried EVERYTHING I can think of and NOTHING has worked any suggestions would be GREATLY appreciated!!!

Dawn Bradley

Program Problem Needs Fixed Fast!! Please Help {Access Report Print Preview}
I have a program that has a couple problems that have to be fixed yesterday.

I need to get the program to do a print preview or page setup (be able to specify which pages they want to print, like pages 23-31 of 45 or page 27 of 45) Can anyone help me with code that does this without giving them access to the whole database.

The code that i am using currently is:


If txtSpot.Text = "" Then
Else
'Set index property required for seek
datMachine.Recordset.Index = "spotnumber"

'Seek a record in the task table to see if the spot number exists
datMachine.Recordset.Seek "=", txtSpot.Text
If datMachine.Recordset.NoMatch = True Then
MsgBox "Please enter a valid machine spot number"
txtSpot.SetFocus
Save = False
Action = vbDataActionCancel
Exit Sub
End If
lblspot.Caption = txtSpot.Text
datDate.Recordset.Edit
datDate.Recordset.Update
End If

If Timer1.Tag = "" Then
Timer1.Tag = "4"
Timer1.Enabled = True
Exit Sub
End If

'Prints the Task Report from Access to the users default printer
Dim objAccAppl As Access.Application
On Error GoTo ErrorHandler
If txtSpot.Text = "" Then
Set objAccAppl = GetObject("C:dp283dp283.mdb")
objAccAppl.DoCmd.OpenReport "task", acViewNormal
Else
Set objAccAppl = GetObject("C:dp283dp283.mdb")
objAccAppl.DoCmd.OpenReport "task2", acViewNormal
End If
Timer1.Tag = ""

Exit Sub
ErrorHandler:
MsgBox "Please make sure that the printer is on, has paper and is not currently in use"


I can do a print preview with this code:

'added changes to test for print preview
'***************************************
'Set objAccAppl = GetObject("C:dp283dp283.mdb")
'objAccAppl.DoCmd.OpenReport "task", acViewPreview
'objAccAppl.Visible = True
'
'If vbOK = MsgBox("Continue with print?", vbOKCancel) Then
'Else
' Unload Me
' End
'End If
'
'objAccAppl.DoCmd.OpenReport "task", acViewNormal
'
'objAccAppl.Quit acQuitSaveNone
'Set objAccAppl = Nothing
'***************************************
'end of changes

but it lets you do a print preview in Access of the report that is selected. But this also lets them roam free in the database. The can close the selected report or hit design view or any other things that you can do if you just double clicked on the actual database. I only want them to be able to see the report and then pick a page or range of pages to print from.

Another problem that I am having is:

The problem is that when it prints, it first prints the report very about 3 inches by 2 inches in the top left corner. It is the full page and everything is correct but it just prints the whole page really small in that corner. On the second try of printing the report it prints fine. Is there any fix for this?


PS
I was told that this problem is supposed to be in a printer forum? I cannot find a forum dedicated to periphals or printers, so I am posting here. If you know where I am to move this thread please e-mail me or pm me.

Thanks for all of your help,
Richard

Print Single Line Of Data From MS Access Report/table/query
Hello,

I currently have a vb project in which I can view reports. What I need is...to be able to have a button on my screen in which I can just printout the last recorded data straight to a printer. I guess I need to know how to query the data through VB and then how to print it straight to a printer.

Sounds simple...but is it?

Thanks!

Automatically Print Data Report Without Clicking Print Icon
is it possible to print records in the data report without loading it clicking on the print icon??? i want the printer to print my data report once i click a message box...but it shouldnt show any datareport...

Activate The Print Dialox Box When I Print A Data Report
Hello!

I use Visual Basic 6.0.

I have made differents reports with the Data Report component. My problem is when I try to print one of them. I use the next statement:

LlEsmArtReg.PrintReport True

The 'True' is becaruse I want show the Print Dialog Box.

My problem is that the Print Dialog Box not appear at the front, instead of that appears on the back. So the final user have to make a 'Alt+Tab' to see this Dialog Box.

Someone can tell me how to do for this Dialog Box appear at the front, automatically?

Thanks,
Eva Janakieff

Print A Report Without Coick The Print Buttion
using crystal report and want to print a report without click the print button.

thank you

Using Print Engine API To Print Crystal Report From VB
I am trying to run a Crystal Report (ver 7) from a VB app (ver 6) using the
Print Engine API.
The report links to tables in an Oracle (ver 7.3.4) database via ODBC.
I use VB to collect the parameters to pass them to the report.
All seems to work fine until the end of this code when I try to display the
report.
The report window opens momentarily, then closes.
The last MsgBox reports an error code of 599.
I have been able to determine that apparently I need to Logon to the server.
However, there is not enough documentation on how to use PELogonServer or
PESetNthTableLogOnInfo.
Can someone enlighten me or at least point me to some decent reference
material?

'''### copy of code ###'''
Dim txtValu(2) As String
txtValu(0) = txtSDate.Text
txtValu(1) = txtEDate.Text
RptName = App.Path & "SO_003.rpt"

ParamInfo.StructSize = PE_SIZEOF_PARAMETER_FIELD_INFO
valueInfo.StructSize = PE_SIZEOF_VALUE_INFO

Handle = PEOpenEngine
job = PEOpenPrintJob(RptName)
ParamNum = PEGetNParameterFields(job)
For i = 0 To (ParamNum - 1)
Result = PEGetNthParameterField(job, i, ParamInfo)
valueInfo.valueType = PE_VI_DATE
valueInfo.viDate(0) = Year(CDate(txtValu(i)))
valueInfo.viDate(1) = Month(CDate(txtValu(i)))
valueInfo.viDate(2) = Day(CDate(txtValu(i)))
Result = PEAddParameterCurrentValue(job, ParamInfo.Name, _
ParamInfo.reportName, valueInfo)
If Result = 0 Then
ErrorNum = PEGetErrorCode(job)
MsgBox "The call PEAddParameterCurrentValue failed"
MsgBox "The error code is: " & ErrorNum
End If

Next i
Handle = PEOutputToWindow(job, RptName, 0, 0, 520, 520, 0, 0)
If Handle = 0 Then
ErrorNum = PEGetErrorCode(job)
MsgBox "The output cannot be sent to the window"
MsgBox "The error code is " & ErrorNum
Else
Handle = PEStartPrintJob(job, True)
If Handle = 0 Then
ErrorNum = PEGetErrorCode(job)
MsgBox "An error occurred while trying to start the Print Job."
MsgBox "The error code is " & ErrorNum
End If
End If



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

What's Logon Parameter To Oracle Server With Vb To Print Report With Crystal Report
Hi all,

How to write a log on parameter to oralce server with using vb to print a report that using crystal report

is it crystalreport1.connect = "Dsn=servername;uid=username;pwd=password"

and how to use the selectionformula

Show Print Dialog When Printing Report With Crystal Report
Hi there,

In my code when I press on the printing button I want it to show the printing dialog to choose printer and tray which I will print out.

My code like this:

Public Report As CRAXDRT.Report
Set Report = crxApp.OpenReport(App.path & "Data
ptBDM.rpt")
Report.PrintOut true

With these code it only let me choose from page to page not for printer and tray.

Thanks a lots.

Crystal Report, Print 3 Diff Copies Of A Report
Dear Friends

I am using crystal report 8 in visual basic 6, back end access 97. I want to print 3 copies of Invocie. Like first copy should be marked as "Original" Second "Accounts" and third "Record Copy".

I tried a lot but could not succeed. Please check out this

Zubair Khan

Print A3 Report In A4 Size For Crystal Report
Hi, i do have a hugh report designed for A3 paper, how could i get it printed on an A4 size paper?
i.e. the overflown portion is printed on a second A4 paper.

any suggestion is appreciated

Print An A3 Report On A4 Paper For Crystal Report
Hi, i do have a hugh report designed for A3 paper, how could i get it printed on an A4 size paper?
i.e. the overflown portion is printed on a second A4 paper.

any suggestion is appreciated

Help Crystal Report Print Stock Report
I am using Visual Basic 6.0 and Crystal Reports 8.5 for my Stock project.
I would like to ask how to produce the following report :

Date     Invoice Item     Quantity Metric
--------------------------------------------
01-09-04 A     A001     1500 Kilogram
02-09-04 B     A001     100 Gram
     ----------------------------------
     Subtotal :        1 Ton
             500 Kilogram
             100 Gram
     ==================================

03-09-04 C     B001     20 Piece
     ----------------------------------
     Subtotal :         1 Dozen
             8 Piece
     ==================================

I already have these functions to convert the values :

Function ConvertToSmall(Item, Quantity, Metric)
     ConvertToSmall(1500100, grams) 'For Item A001
End Function

Function ConvertToLarge(Item, SmallQuantity)
     ConvertToLarge=Array(3,2) -> (1,Ton), (500,Kilogram), (100,Gram)
End Function

These functions can also be used for the B001 with
the metric conversion (Dozen, Piece, Gross) = (12,1,144) in which
1 Dozen = 12 Piece, 1 Gross = 12 x 12 = 144 Piece.

And does the 8.5 version support the bar-code printing?

I would really appreciate if anyone could help me.
thanks

How To Print A Landscape Report With Data Report
Hi,
How can I build a landscape Report with Data Report ?
Each time I enlarge my Data Report, when I run it, I have a message "the report is larger than the paper" (it is an approximative translation of the message, because I got it in french !)
Thank you in advance.
Jeremie
RENNES
FRANCE

Print Access Reports With Values Passed To A Access Query From A Textbox On A Form.
Hello,


DB = access 2000
Method = DAO

This is my first post on this forum, I'm new to VB.

I am trying to print a report from access using VB, but what I would like to do is pass values to the query and then print the report based on the the results of the query that had values passed to it. I'm able to pass values to the query that works well.
also I'm able to print the report but I have to pass values to it using the dialog boxes that Access 2000 provides.

Is there a way to print the report that uses the query with the values that have been passed to it through the form?

***Code for printing reports***

Private Sub cmdReport_Click()

  Set MSAccess = New Access.Application

  MSAccess.OpenCurrentDatabase ("C:Documents and SettingsfiqbalDesktopdb1.mdb")
  MSAccess.DoCmd.OpenReport "Report based on Para Passing", acViewNormal
  MSAccess.CloseCurrentDatabase
  Set MSAccess = Nothing
    
End Sub

***End of Code****

***Code for Passing values from a textbox on a form***

sqlstr = "select * from Table1 where [name] ='" & Text1.Text & "' and [phone] ='" & Text2.Text & "'"

*** End of Code****

How can I get the report to use the above SQL without the access dialog boxes and the values just being passed from the text boxes.

would appreciate all the help

thanx in advance.

Kinara

Storing And Retriving Images From Access Databse Through VB Data Report Or Crystal Report
hi friends
    i have a problem that i have a database of some 8000 students in which there is a field called "photo" which stores the photograph. it is stored as BLOB field. now i want to retrive it in my report. i'm getting very much difficulties in it. can i have a help from master minds to resove the same. it will be very much helpful to me.
    my e-mail id: nnpatwa@yahoo.com
  ur suggestions r welcome. anybody can mail me. hoping for the best.

Crystal Report Crosstab Report Criteria Selection Using Access 2000
Hi there
I there anyone with an idea on how i can filter crosstab Report done in Crystal Report 8.5.. I'm trying to get data btw two dates for instance 05/01/04 and 05/31/04 but the following code doesn't do that. I'm using access 2000 database. Pls assist.

fMainForm.CrystalReport1.ReportSource = crptReport
fMainForm.CrystalReport1.ReportFileName = "F:OutGrowerReportsGLdelivered.rpt"
fMainForm.CrystalReport1.SelectionFormula = "Wdate" >= " & {CrossTabData.WDate} =" & "'" & CDate(DTPicker2.Value) & " AND Wdate" <= " & {CrossTabData.WDate}=" & "'" & CDate(DTPicker2.Value) & "'"
fMainForm.CrystalReport1.WindowState = crptMaximized
fMainForm.CrystalReport1.PrintReport
fMainForm.CrystalReport1.PageZoom (100)

or is there another better way to do this.

Copyright 2005-08 www.BigResource.com, All rights reserved