QR Code generator using MS Access | MS Access VBA | Rover
HTML-код
- Опубликовано: 20 окт 2024
- ell come to rover RUclips channel. Today I am going to show you how to create a QR code generator using MS Access. Here I use simple VBA code for this project.
Download code file by clicking following link
drive.google.c...
#rover #msaccess #vba
Many many thanks for this great effert!!!
SEI UN GRANDE, lo sarai ancora di più , il tempo di provarlo. :-)
Thats Incredible!!! Congrats for your work for us!
Your video is the first that, I really seen that shows the potential of QR codes being generated in access. A big thanks!!!! Is the a way to save QR image as the name of the text box data?
Hi
change this line - savePath = Application.CurrentProject.Path & "\qr_code.bmp"
to savePath = Application.CurrentProject.Path & "\" & qrData & ".bmp"
Excel work. Thanks so much.
Einwandfreie Funktion. Kann ich nur empfehlen
thanks, really good job
Hi, this error appears, how can I resolve it? Thank you, "Compilation error: Invalid topic number or property"ssignment" alla riga : result = URLDownloadToFile(0, apiUrl, savePath, 0, 0), si evidenzia : "URLDownloadToFile(0, apiUrl, savePath, 0, 0)"
You are great thank you very much
I will try it
Words do not appear in the QR if the language is Arabic
Very Nice... thanks a Lot!! it was used in my Project successfully... will it work permanently or like trail? bze it is depending on other website..
how can the QR be shown in the report
amazing it works thank you again
ازاي ممكن اظهر ال QR في التقرير
very good
Thanks
Thank you.
Sorry i cannot use the general code on ms acces 64 byte, can you support
good
Best🎉
Excellent!
it doesnt work for russian language, why?
Any suggestions for MS Access 64 Bit
Try Changing the declaration at the top to :
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#If VBA7 Then
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As LongPtr, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As LongPtr, ByVal lpfnCB As LongPtr) As Long
#Else
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#End If
Private Sub btnGenerateQR_Click()
' Declare variables
Dim apiUrl As String
Dim qrData As String
Dim savePath As String
Dim result As Long
' Get QR data from textbox
qrData = Me.txtqrdata.Value
' Construct API URL
apiUrl = "api.qrserver.com/v1/create-qr-code/?data=" & qrData & "&size=200x200"
' Specify save path for BMP file in the same directory as the Access database
savePath = Application.CurrentProject.Path & "\qr_code.bmp"
' Download QR code image as BMP file
#If VBA7 Then
result = URLDownloadToFile(0, apiUrl, savePath, 0, 0)
#Else
result = URLDownloadToFile(0, apiUrl, savePath, 0&, 0&)
#End If
' Check if download was successful
If result = 0 Then
' Display the downloaded image in the image control
Me.imgQRCode.Picture = savePath
Else
MsgBox "Failed to download QR code image.", vbExclamation
End If
End Sub
Include multiple fields and then retrieve them in another table
for ms acess 64bit failed
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As LongPtr, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As LongLong, ByVal lpfnCB As LongPtr) As LongPtr
Try Changing the declaration at the top to :
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#If VBA7 Then
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As LongPtr, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As LongPtr, ByVal lpfnCB As LongPtr) As Long
#Else
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#End If
Private Sub btnGenerateQR_Click()
' Declare variables
Dim apiUrl As String
Dim qrData As String
Dim savePath As String
Dim result As Long
' Get QR data from textbox
qrData = Me.txtqrdata.Value
' Construct API URL
apiUrl = "api.qrserver.com/v1/create-qr-code/?data=" & qrData & "&size=200x200"
' Specify save path for BMP file in the same directory as the Access database
savePath = Application.CurrentProject.Path & "\qr_code.bmp"
' Download QR code image as BMP file
#If VBA7 Then
result = URLDownloadToFile(0, apiUrl, savePath, 0, 0)
#Else
result = URLDownloadToFile(0, apiUrl, savePath, 0&, 0&)
#End If
' Check if download was successful
If result = 0 Then
' Display the downloaded image in the image control
Me.imgQRCode.Picture = savePath
Else
MsgBox "Failed to download QR code image.", vbExclamation
End If
End Sub
not working
Mine is getting hung up on "Me.imgQRCode.Picture=savepath". How do I correct this? I have named the image box imgQRcode. Thus, I'm not sure if its not the save path
Hi, any update on this? im also getting this error also. thanks