Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old September 16th, 2003, 11:13 AM
utmostrusselb utmostrusselb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Canada
Posts: 40 utmostrusselb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Text Boxes

What is the best way to send text box information straight to an Access report for printing without using a database?

Reply With Quote
  #2  
Old September 16th, 2003, 08:26 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,550 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 15 h 43 m 35 sec
Reputation Power: 640
What do you mean by send to an access report without using a database? You can send text directly to a printer from VB, or call up the printer dialog.

Reply With Quote
  #3  
Old September 16th, 2003, 11:15 PM
utmostrusselb utmostrusselb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Canada
Posts: 40 utmostrusselb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I have a report that is done in Access with labels and graphics. I want to populate the details section of the report with the information in the text boxes. I can temporarily save it to the database, but then I would just have to delete the records once it is printed. I don't need anything but a printed record of the text box information. Also, can I use the VB Report Designer without making a Data Enviroment connection instead?

Reply With Quote
  #4  
Old September 17th, 2003, 12:21 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via MSN to cleverpig
I think u need use the Data Enviroment connection to save data to access..

Reply With Quote
  #5  
Old September 17th, 2003, 10:37 AM
utmostrusselb utmostrusselb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Canada
Posts: 40 utmostrusselb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thanks. I don't want to save my info in the database if I don't have to, just print it from an Access report. The Access report looks the best. After the report is printed, I do not need the information, so it doesn't seem like a good idea to save the data to the database and then delete it all. It isn't a good programming technique.

Reply With Quote
  #6  
Old September 17th, 2003, 01:42 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,550 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 15 h 43 m 35 sec
Reputation Power: 640
I suppose you could use VBA code in the report to grab the textbox information, assuming you call the report from a button on a form or something similar. I haven't done this but it should be doable, the report can have an underlying VBA code page.

Reply With Quote
  #7  
Old September 18th, 2003, 03:34 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via MSN to cleverpig
Printing and Viewing Access Reports (VBA)

This code enables you to specify a Microsoft Access database open a report and print it out or open in preview form through Visual Basic.

Create a module and place the following inside:


code:--------------------------------------------------------------------------------'Code written by Ryan Wischmeyer

'This code is intended for educational use

'and may not be implemented into projects

'which are to be sold for retail value.

Option Explicit

' In other applications like Microsoft Visual Basic,

' you can include a reference to Microsoft Access to

' gain the use of Access constants. Or, use the following

' constant values...

Global Const acNormal = 0

Global Const acDesign = 1

Global Const acPreview = 2

' -----------------------------------------------------

' Application Quit options...

' saves all objects without displaying a dialog box:

Global Const acSaveYes = 0

' displays a dialog box that asks whether you want to save any

' database objects that have been changed but not saved:

Global Const acPrompt = 1

' quits Microsoft Access without saving any objects:

Global Const acExit = 2

Sub PrintAccessReport(dbname As String, rptname As String, preview As Boolean)

Dim objaccess As Object

On Error GoTo PrintAccessReport_ErrHandler

Set objaccess = CreateObject("Access.Application")

With objaccess

.OpenCurrentDatabase filepath:=dbname

If preview = True Then 'Preview report on screen.

.DoCmd.OpenReport reportname:=rptname, View:=acPreview

.Visible = True

.DoCmd.Maximize 'maximizes the Report window

.DoCmd.Maximize 'maximizes Access window

Else 'Print report to printer.

.DoCmd.OpenReport reportname:=rptname, View:=acNormal

DoEvents 'Allow report to be sent to printer.

End If

End With

Set objaccess = Nothing

Exit Sub

PrintAccessReport_ErrHandler:

MsgBox Error$(), , "Print Access Report"

End Sub--------------------------------------------------------------------------------


Now Call this procedure with a command button or whatever replacing the example below with the desired parameters. The first parameter requests the path to the database, the second requests the Report name, and the third requests the view state: True will open access and display the report, False will just print the report.


code:--------------------------------------------------------------------------------Call PrintAccessReport App.Path & "collectables.mdb", "Figures", True

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Text Boxes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway