Solved Save Report As PDF on MS access (1 Viewer)

Rania01

Member
Local time
Today, 14:40
Joined
Oct 9, 2021
Messages
59
Dear All,
I want to save Raport in pdf by name, depending on the information in the Claimnumber ( textbox) and City (combobox) With below macros I get the results. 235645262.PDF instead of 23564526 BDN. PDF
Claimnumber = 23564526

City (combobox) :
ID data type
1 DPS
2 BDN
3 JKT
I hope you can help with the macros.


Code:
Private Sub SAVE_To_PDF_Click()
Dim FileName As String
Dim FilePath As String

FileName = Me.Claimnumber & " " & Me.City
FilePath = "C:\MS ACCESS\" & FileName & ".PDF"
DoCmd.OutputTo acOutputReport, "Report", acFormatPDF, FilePath
MsgBox "Done", vbInformation, "Save Confirm"
End Sub
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:40
Joined
Sep 21, 2011
Messages
14,041
You need to DlookUp the datatype using the transporteur or better still

Me.transporteur.column(1)
 

Rania01

Member
Local time
Today, 14:40
Joined
Oct 9, 2021
Messages
59
You need to DlookUp the datatype using the transporteur or better still

Me.transporteur.column(1)
Hello Gasman,
How to do that with the VBA
Could you please check the VBA
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:40
Joined
Sep 21, 2011
Messages
14,041
Google how to access another column from a combo, though I have pretty much given you the code already with the second option?
Now you have changed the code😔
Me.city.column(1)
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:40
Joined
Sep 21, 2011
Messages
14,041
I get error method or data member not found
OK. The syntax is Me.WhateverYourComboIsCalled.Column(1) if it is as you showed in the first post?
 
Last edited:

bastanu

AWF VIP
Local time
Today, 06:40
Joined
Apr 13, 2010
Messages
1,401
Make sure you use the name of the combo box control not the field the combo is bound to. And make sure you have set the combo's column count property to 2.

Cheers,
 

Users who are viewing this thread

Top Bottom