Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Barcode code

Posted on 1999-07-13
8
Medium Priority
?
224 Views
Last Modified: 2013-11-18
Is there any code (not .vbx or .ocx) that can produce barcodes? If so, can you please tell me where I can obtain it?
0
Comment
Question by:rsolomon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 1

Accepted Solution

by:
Jaysin28 earned 800 total points
ID: 1524344
We use a random number generator and then set the font to a font called 3of9.  Most barcodes programs use this scheme since there isn't a data type of Bar code.

Try doing this with your app.
0
 

Author Comment

by:rsolomon
ID: 1524345
Give me an example. I don't know what you are taking about, when you say use a random number generator.
0
 
LVL 1

Expert Comment

by:Jaysin28
ID: 1524346
VB has a Random Number Generator.  Using Rnd the system will pick a random number.

i.e.

MyValue = Int((6 * Rnd) + 1)   ' Generate random value between 1 and 6.

Before making this call however to ensure that the same number isn't generated twice you also have to call:

Initializes the random-number generator.

Syntax

Randomize [number]

The optional numberargument is aVariant or any validnumeric expression.

Remarks

Randomize uses number to initialize the Rnd function's random-number generator, giving it a newseed value. If you omit number, the value returned by the system timer is used as the new seed value.

If Randomize is not used, the Rnd function (with no arguments) uses the same number as a seed the first time it is called, and thereafter uses the last generated number as a seed value.

Note   To repeat sequences of random numbers, call Rnd with a negative argument immediately before using Randomize with a numeric argument. Using Randomize with the same value for number does not repeat the previous sequence

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:rsolomon
ID: 1524347
Ok I understand the RND function, how do you incorporate this into code?
0
 
LVL 1

Expert Comment

by:Jaysin28
ID: 1524348
Public sub Form_Main()

Randomize
MyValue = Int((32000 * Rnd) + 1) 1 to 32000

myDatabase.fields("Barcode") = cStr(MyValue)

end sub

When viewing this value anywhere (label, textbox, etc.) set the font to 3 of 9..  This will show a barcode representation of the number.
0
 

Author Comment

by:rsolomon
ID: 1524349
Would you just set the font on the printer control,
like pctl.font = "3of9"?
0
 
LVL 1

Expert Comment

by:Jaysin28
ID: 1524350
YEs, but this has to be a valid True Type font that exists in the Windows\Fonts directory, and the Printer you are using needs to be able to read true type fonts.  (most of them do).  If you need the font then send mail to Jaysin28@aol.com and provide your email address.  I will send it.
0
 

Author Comment

by:rsolomon
ID: 1524351
thanks

ronald.solomon@usa.net
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question