if you have an internet connection, you may try the code in the class.
this one is written in vb. never tried it though.
first put an image control on your report for the qrcode.
on the load event of your report, get the qrcode:
dim qrCode As clsQRCode
private sub report_load()
set qrCode = New clsQRCode
' "text" means the text to make qr code, it can be from a textbox on your report
me.image_control.picture = qrCode.GetPictureQrCode("text", me.image_control.Width, me.image_control.Height)
If me.image_control.Picture Is Nothing Then MsgBox "Error!"
end sub
I installed IDAutomation Data Matrix Font Encoder and imported the .bas file into Modules. Then in report I created a text box and changed the control source as "=EncDM([Table_name].[Field_name])". Then I changed the font into "IDAutomation2D XLS". But It is not generating a QR.
you extract the clsQRCode.cls to a folder.
on vbe, File->Import. and point to the file where you extract the class.
follow the steps on my first post.
i am unable to use this class because im lazy converting it to x64. i use x64 access.
you extract the clsQRCode.cls to a folder.
on vbe, File->Import. and point to the file where you extract the class.
follow the steps on my first post.
i am unable to use this class because im lazy converting it to x64. i use x64 access.
Error "variable not defined" at CreateBitmapPicture function
With Pic
.Size = Len(Pic) ' Length of structure .Type = vbPicTypeBitmap ' Type of Picture (bitmap)
.hBmp = hBmp ' Handle to bitmap
.hPal = hPal ' Handle to palette (may be null)
End With
If I change the above code to the below one, no error is detected under this function. Assume "1" means bitmap file
With Pic
.Size = Len(Pic) ' Length of structure .Type = 1 ' Type of Picture (bitmap)
.hBmp = hBmp ' Handle to bitmap
.hPal = hPal ' Handle to palette (may be null)
End With
forget about that, i think it uses
internet connection to create the qrcode.
here is another sample. doesnt
require internet connection.
there is sample form and report too.
if you want to adapt this to your db,
copy all Modules to your db.
and the AutoExec and the hiddenForm.
you need hidden form because it
is called form AutoExec macro to
instantiate Excel and extract
the excel file (the one who makes
the QR). when the applicatin closes
the hidden form does the housekeeping,
closing Excel and the excel file.
removing some other stuffs.
sorry for the sample, its unpolished.
if you have qrcode Reader on your
cellphone you can try to scan
if it is producing the correct code.
(on my test it passed all).
forget about that, i think it uses
internet connection to create the qrcode.
here is another sample. doesnt
require internet connection.
there is sample form and report too.
if you want to adapt this to your db,
copy all Modules to your db.
and the AutoExec and the hiddenForm.
you need hidden form because it
is called form AutoExec macro to
instantiate Excel and extract
the excel file (the one who makes
the QR). when the applicatin closes
the hidden form does the housekeeping,
closing Excel and the excel file.
removing some other stuffs.
sorry for the sample, its unpolished.
if you have qrcode Reader on your
cellphone you can try to scan
if it is producing the correct code.
(on my test it passed all).
Depending on the volume of codes you need to generate, you could use the Google Charts API to generate QR Codes.
Simply add a "Microsoft Web Browser" ActiveX component and the following code to your Form:
Code:
Dim Size As Integer
Dim Text As String
Dim URL As String
Size = 200
Text = "This is my test"
' Better to actually use a URL encoding function like those described here:
' http://stackoverflow.com/questions/218181/how-can-i-url-encode-a-string-in-excel-vba
Text = Replace(Text, " ", "%20")
URL = "http://chart.apis.google.com/chart?chs=" & Size & "x" & Size & "&cht=qr&chld=H|0&chl=" & Text
WebBrowser.Navigate (URL)
You can of course change the Size and the Text depending on your need. The Text can also be a value directly from your Form, therefore your data.
I would advise you to check Googles Terms and Services before using it.
forget about that, i think it uses
internet connection to create the qrcode.
here is another sample. doesnt
require internet connection.
there is sample form and report too.
if you want to adapt this to your db,
copy all Modules to your db.
and the AutoExec and the hiddenForm.
you need hidden form because it
is called form AutoExec macro to
instantiate Excel and extract
the excel file (the one who makes
the QR). when the applicatin closes
the hidden form does the housekeeping,
closing Excel and the excel file.
removing some other stuffs.
sorry for the sample, its unpolished.
if you have qrcode Reader on your
cellphone you can try to scan
if it is producing the correct code.
(on my test it passed all).
But if import all MS Access objects into current application ACCDB (Around 36MB), the error is shown at the attachment. Not too sure it has something to do with the ACCDB file size or not .
forget about that, i think it uses
internet connection to create the qrcode.
here is another sample. doesnt
require internet connection.
there is sample form and report too.
if you want to adapt this to your db,
copy all Modules to your db.
and the AutoExec and the hiddenForm.
you need hidden form because it
is called form AutoExec macro to
instantiate Excel and extract
the excel file (the one who makes
the QR). when the applicatin closes
the hidden form does the housekeeping,
closing Excel and the excel file.
removing some other stuffs.
sorry for the sample, its unpolished.
if you have qrcode Reader on your
cellphone you can try to scan
if it is producing the correct code.
(on my test it passed all).
I know that QRCodes can be made in colors as we use them when we are using MSWord Mail Merge and ZINT Barcode Studio to create them.
What I am just trying to find out is how to modify the template that arnelgp had provided. I am trying to see if there is a setting somewhere or is there alot of code to change.