m-taha
New member
- Local time
- Today, 07:02
- Joined
- Dec 6, 2019
- Messages
- 29
So i have this code, a function that creates a qr code from the information it gets and stores it in a file on my pc. and opens a report with a picture of the qr code on it, and to refresh it every time it's called when runnung the invoice code.
this the function:
And this is the invoice code which exists within a Command button:
(You can clearly see where i mess things up trying to make it work)
and also bellow i attached 2 screenshots of report in page form and design mode.
i really appreciate any kind of help, i've been on this project for months now and it's getting really frustrating. So i really appreciate every bit help. Thank you .
this the function:
Code:
Public Function qr_erstellen(k_name As String, d_name As String, k_plz As String, d_plz As String, k_stadt As String, d_stadt As String, k_land As String, d_land As String, k_str As String, d_str As String, k_str_nr As String, d_str_nr As String, k_betrag As Single, d_iban As String, Bericht As String) As PngByteQRCode
Dim qr As QRCoderVBA
Set qr = New QRCoderVBA
Dim k_referenz As String
Dim filename As String
filename = "QR_" & k_name & Date
qr.setCreditor k_name, k_plz, k_stadt, k_land, k_str, k_str_nr
qr.setAmount k_betrag
qr.setDebitor d_name, d_plz, d_stadt, d_land, d_str, d_str_nr
qr.setIban d_iban
qr.setReference ("")
qr.GenerateSwissQRCode ("C:\Entwicklung\Mathani\QR_PIC\" & filename & ".png")
Dim pfad As String
pfad = "C:\Entwicklung\Mathani\QR_PIC\" & filename & ".png"
DoCmd.OpenReport Bericht, acPreview
Reports(Bericht)!QRBild.Picture = pfad
DoCmd.Close acReport, Bericht, acSaveYes
'png löschen
'Kill pfad
End Function
And this is the invoice code which exists within a Command button:
(You can clearly see where i mess things up trying to make it work)
Code:
Private Sub Bef_Rechnung_drucken_Click()
On Error GoTo Err_Bef_Rechnung_drucken_Click
'Datensatz speichern
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenQuery "qryStundenrapport_Bereinigung_1"
DoCmd.OpenQuery "qryStundenrapport_Bereinigung_2"
DoCmd.OpenQuery "qryStundenrapport_Bereinigung_3"
DoCmd.OpenQuery "qryStundenrapport_Bereinigung_4"
DoCmd.OpenQuery "qryRechnungspositionenLoeschen"
DoCmd.OpenQuery "qryRechnungspositionenArbeitsleistungHinzufuegen"
DoCmd.OpenQuery "qryRechnungspositionenMaterialHinzufuegen"
DoCmd.OpenQuery "qryRechnungspositionenDrittleistungenHinzufuegen"
Dim d_name As String
Dim d_plz As String
Dim d_stadt As String
Dim d_str As String
Dim d_str_nr As String
Dim d_iban As String
Dim Mandant As Integer
Mandant = GetMandant()
d_name = DLookup("Wert", "tblMandantEinstellungen", "Einstellung = 'firmenname'")
d_plz = "9000"
d_stadt = "berlin"
d_str = "West"
d_str_nr = "154"
d_iban = "CH4431999123000889012"
'k_name As String, d_name As String, k_plz As String, d_plz As String, k_stadt As String, d_stadt As String, k_land As String, d_land As String, k_str As String, d_str As String, k_str_nr As String, d_str_nr As String, k_betrag As Single, d_iban As String, Bericht As String
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Call mdlQR.qr_erstellen("Dolly", d_name, "1245", d_plz, "paris", d_stadt, "CH", "SE", "kstrasse", d_str, "kstrnr", d_str_nr, "45698", "CH4431999123000889012", "berRechnung")
Dim stDocName As String
stDocName = "berRechnung"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize
Exit_Bef_Rechnung_drucken_Click:
Exit Sub
Err_Bef_Rechnung_drucken_Click:
MsgBox err.Description
Resume Exit_Bef_Rechnung_drucken_Click
End Sub
and also bellow i attached 2 screenshots of report in page form and design mode.
i really appreciate any kind of help, i've been on this project for months now and it's getting really frustrating. So i really appreciate every bit help. Thank you .