VBA barcode code generator not working (1 Viewer)

smig

Registered User.
Local time
Tomorrow, 00:35
Joined
Nov 25, 2009
Messages
2,198
I use the free 3to9 font.
I deploy it wherever I put my db

Clean and easy :)
 

Alhakeem1977

Registered User.
Local time
Tomorrow, 01:35
Joined
Jun 24, 2017
Messages
308
Could be this Link:-

And Here some VBA:-
Thanks Uncle Gizmo for your attention. I think the second code will fit my desired, that I searched a lot of threads and tried many of them almost generate the QR code but unfortunately, it's not stand alone codes, the user machine should be connected to the internet, and it will not work in our office environment, hence, I think this code will help me to generate a stand alone MS Access application, how can I call this code means from a text box in my form or report to be printed? Please when you get free time, I would appreciate your help.
Thanks in advance!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:35
Joined
Jul 9, 2003
Messages
13,553
how can I call this code means from a text box in my form or report to be printed?

I don't know!

You already have the code for putting a single line inside a textbox and displaying it on the report. I don't understand this process, and and I haven't investigated it to see how it works.

But printing it, that's your starting point, can you print it? You need to see if you can convert the line into a square, as a square is the basic element of a QR Code. You need to prove that this method can produce a square.

Next you need to know if you can add extra Lines with this method. Can you add a line of squares followed by another line of squares underneath?

If you discover you can, then you need to decide on the size of of QR code you wish to create.

The size of the QR code you need to create will depend on the information you want to present with it. Follow this link here for more information:- https://www.qrcode.com/en/about/version.html

Let's assume you need a 25 by 25 QR code. That means you need to be able to add 25 squares across and 25 squares down in your text box.

If you achieve this, then you need to check that you can control the appearance of the squares with some simple tests. Can you print every other square so you have a chequerboard effect? If you can achieve that, then you are probably going to be able to take it further.

The next stage is to start deciphering the VBA code to see how it it modifies the Excel spreadsheet. Then see if you can apply that VBA code to the process of adding the lines in the text box..

None of this is trivial, but it is small/manageable steps, but it will take many hours, probably weeks and many iterations until you perfect it.

But first of all you have to prove that it is possible to modify what you present in the text box.

If you decide to undertake this project I suggest you start a new thread in Access World Forums. I'm sure that if you show willing to take on this project you will get some of the best help available. Also I wouldn't be too restricted in how you want to approach this, as there are many people here who have vast experience and might be able to steer you in a completely different direction.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:35
Joined
Jul 9, 2003
Messages
13,553
Report.Circle method (Access)

It appears you can do a lot with this method of adding things to the report, so I think there is definitely some hope.

The code here for handling circles on report, and even creating pie slice shapes and colouring them in demonstrate ways to handle the different things you may need to do.
 

Alhakeem1977

Registered User.
Local time
Tomorrow, 01:35
Joined
Jun 24, 2017
Messages
308
I don't know!

You already have the code for putting a single line inside a textbox and displaying it on the report. I don't understand this process, and and I haven't investigated it to see how it works.

But printing it, that's your starting point, can you print it? You need to see if you can convert the line into a square, as a square is the basic element of a QR Code. You need to prove that this method can produce a square.

Next you need to know if you can add extra Lines with this method. Can you add a line of squares followed by another line of squares underneath?

If you discover you can, then you need to decide on the size of of QR code you wish to create.

The size of the QR code you need to create will depend on the information you want to present with it. Follow this link here for more information:- https://www.qrcode.com/en/about/version.html

Let's assume you need a 25 by 25 QR code. That means you need to be able to add 25 squares across and 25 squares down in your text box.

If you achieve this, then you need to check that you can control the appearance of the squares with some simple tests. Can you print every other square so you have a chequerboard effect? If you can achieve that, then you are probably going to be able to take it further.

The next stage is to start deciphering the VBA code to see how it it modifies the Excel spreadsheet. Then see if you can apply that VBA code to the process of adding the lines in the text box..

None of this is trivial, but it is small/manageable steps, but it will take many hours, probably weeks and many iterations until you perfect it.

But first of all you have to prove that it is possible to modify what you present in the text box.

If you decide to undertake this project I suggest you start a new thread in Access World Forums. I'm sure that if you show willing to take on this project you will get some of the best help available. Also I wouldn't be too restricted in how you want to approach this, as there are many people here who have vast experience and might be able to steer you in a completely different direction.
Thank you so much, I will do my best to try that later, unfortunately, my wife got sick and I will not get enough time to implement this. But once my wife recovered from her sickness, I will follow the steps you provided and let you know the result.
Thanks again for your efforts.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:35
Joined
Jul 9, 2003
Messages
13,553
But once my wife recovered from her sickness, I will follow the steps you provided and let you know the result.

Oh, that's not good. I hope it's nothing too serious.

Best wishes...
 

strive4peace

AWF VIP
Local time
Today, 16:35
Joined
Apr 3, 2020
Messages
601
I've been lurking and have yet to say anything yet because I haven't had time to try it ... I'm quite sure barcodes can be made with the Access Line method, and characters written using Print. Here is a presentation on my free CalendarMaker tool, which uses both of these methods:

CalendarMaker presentation to AccessUserGroups, hosted by Dale Fye, on YouTube (49:05):

and you can download the CalendarMaker ACCDB here:
https://msaccessgurus.com/tool/CalendarMaker.htm

Coordinates are relative to what section the code is attached to (the CalendarMaker uses Page).

best wishes for everyone to be in good health
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:35
Joined
Jul 9, 2003
Messages
13,553
I'm quite sure barcodes can be made with the Access Line method, and characters written using Print

That's good to know thank you Crystal.

Would you have any examples that could be adapted to produce 25 by 25 grid of squares in a chequerboard pattern to test the possibility of producing a QR code?
 

strive4peace

AWF VIP
Local time
Today, 16:35
Joined
Apr 3, 2020
Messages
601
That's good to know thank you Crystal. Would you have any examples that could be adapted to produce 25 by 25 grid of squares in a chequerboard pattern to test the possibility of producing a QR code?

not yet, but now its on my rather long to-do when I get some spare time list ;)
 

JacquesBatumike

New member
Local time
Tomorrow, 00:35
Joined
Jul 27, 2020
Messages
6
Good evening @Alhakeem1977 said of course it's a challenge I'm facing I use Ms Access to generate a list that must have this QRcode that's why I'm looking for this vba code that I can adapt in Ms Access, the example given by our friend @arnelgp doesn't work when I don't have when I have more than 5000 data in a table
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:35
Joined
Jul 9, 2003
Messages
13,553
the example given by our friend @arnelgp doesn't work when I don't have when I have more than 5000 data in a table

Don't you think it would be a good idea to post a link to the code you mention?
 

JacquesBatumike

New member
Local time
Tomorrow, 00:35
Joined
Jul 27, 2020
Messages
6
Option Compare Database
Option Explicit

Public Function GenQRCode(ByRef img As Access.Image, anything As Variant) As String

Dim i As Integer, strFile As String

If Not (IsFormLoaded("hiddenForm")) Then
DoCmd.OpenForm "hiddenForm", , , , , acHidden
End If

SysCmd acSysCmdSetStatus, "Generating QRCode..."

With gxlWB
.Sheets(12).Cells(1, 1).Value = genPictPath()
.Sheets(1).textbox1.Value = anything & ""
.Sheets(1).textbox1_change
'.Sheets(1).Range("A1").Value = _
' DLookup("RefNo", Me.RecordSource)
.Sheets(1).CommandButton1_Click
While gxlApp.CalculationState <> 0 'xlDone
DoEvents
Wend
.Sheets(2).CommandButton1_Click
While gxlApp.CalculationState <> 0
DoEvents
Wend
.Sheets(12).qrtopic
While gxlApp.CalculationState <> 0
DoEvents
Wend
'Debug.Print ""
'For i = 1 To .Sheets.Count
' Debug.Print i & ": " & .Sheets(i).Name
'Next
strFile = .Sheets(12).Cells(1, 1)
End With

img.Picture = strFile
SysCmd acSysCmdClearStatus
GenQRCode = strFile
End Function

Private Function genPictPath() As String
Dim sPath As String
Dim sFile As String
Dim i As Long
i = 1
sPath = TempPath() & "QRCode" & i & ".bmp"
sFile = Dir(sPath)
While sFile <> ""
i = i + 1
sPath = TempPath() & "QRCode" & i & ".bmp"
sFile = Dir(sPath)
Wend
genPictPath = sFile
End Function


here is the code below that makes my computer crash when I put more than 500 data in the table if our friend @arnelgp can help us
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:35
Joined
May 7, 2009
Messages
14,607
i have no time to revisit the code.
please see this one.
 

Attachments

  • xlQRCode.zip
    379.3 KB · Views: 101

JacquesBatumike

New member
Local time
Tomorrow, 00:35
Joined
Jul 27, 2020
Messages
6
Hello @arnelgp thank you very much for your help, would you please allow that when I click on the Generate QRCode button that these codes load directly on the sampleReport and not on the form, thank you also for allowing all the QRcode to be loaded on all the pages of the report because it is a little slow when you want to display the next page, thank you very much for this application we are on the way to find a better solution to this problem, I know you are so busy, I beg you please help us.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:35
Joined
May 7, 2009
Messages
14,607

Users who are viewing this thread

Top Bottom