Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
  #1  
Old July 19th, 2006, 04:26 PM
T.O. T.O. is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 4 T.O. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 18 sec
Reputation Power: 0
Newbie ????

I'm a newbie to visual basic and I was wondering if there was a way to create a button within an access database that when pressed would generate a report as a text file. Any help would be greatly appreciated. Thanks.

Reply With Quote
  #2  
Old July 20th, 2006, 05:18 PM
Akagami Akagami is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 3 Akagami User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 20 m 5 sec
Reputation Power: 0
Post

Quote:
Originally Posted by T.O.
I'm a newbie to visual basic and I was wondering if there was a way to create a button within an access database that when pressed would generate a report as a text file. Any help would be greatly appreciated. Thanks.


Do you want the report to include only specific item of interest? If so you need to first create a main form that is based on a query. The query should contain only unique records. You will then want to place a command button on the main form. You will go into the properties tab of the button, go to the events tab, go to the click event, in the list both choose event procedure, then click on the ellipses next to the list bix. This will take you to the screen where you will write your VBA code.

What you want to do in your VBA code is basically filter the query upon which you based your main form.

Private Sub PrintForm_Click()
Dim strName As String
Dim strFilter As String

' set variable equal to value of [mainform field name] from main form
strName = "='" & Me.[mainform field name] & "'"
'repeat process for multiple field names

' set report fields listed equal to their respective values from the form
strFilter = "[query field name] " & strPartName & " "

' you want the query field name to match up with the field name you have selected on the form

' filter report according to strFilter parameters
With Reports![rptReportName]
.Filter = strFilter
.FilterOn = True
End With

End Sub

Try this site, it really helped me with the report printing from a form:

URL

Hope all of this helps.

Akagami

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Newbie ????


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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT