|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
Quote:
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 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Newbie ???? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|