Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't add start stop character to Barcode 39 font

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
Need to add a barcode serial number to a report that will be used as a coupon. The serial number is kept in GBL_SerNo. CouponSerNo is a textbox on the report that is set to barcode 39 font. The following code will print the bar code, but it will not scan. I found that I need to add an asterisk to the front and back of the barcode data.

DoCmd.OpenReport "rptCoupon", acViewPreview 'Open the Email Report
reports!rptCoupon!CouponSerNo.Value = GBL_SerNo 'Add Serial number

Thinking that it might require to be text id the following.

Dim inSerNo as string
DoCmd.OpenReport "rptCoupon", acViewPreview 'Open the Email Report
inSerNo = CStr(GBL_SerNo)
Reports!rptCoupon!CouponSerNo.Value = "*" & [inSerNo] & "*"

I get an error stating : you can't assign a value to this object. I 've tried adding quotes to the inSerNo but get the same result. I copied this last attempt from a site that gave the above as an example.

Help would be appreciated.

Windows 7
Office 10


Thanks

jpl

 
Need to add: The global is Dim GBL_SerNo as Long.

jpl
 
The global is Dim GBL_SerNo as Long

inSerNo = CStr(GBL_SerNo)

Data type of Reports!rptCoupon!CouponSerNo.Value is what?
 
CouponSerNo is a text box and the text format is plain text.
 
Here is what worked, but with some strangeness.

DoCmd.OpenReport "rptCoupon", acViewPreview 'Open the Email Report
inSerNo = CStr(GBL_SerNo)
Reports!rptCoupon!CouponSerNo.Value = "*" & inSerNo & "*"

I changed the code so that it was just a regular font in the serial number txt box. Then I added the asterisks and it worked, but it was still regular font. Then I changed the font on the text box to barcode 39 and it worked like a champ. Earlier I had noticed that if you try and change the size of a textbox that is set to Barcode font, ACCESS quits working. It seems that there is an irregularity in txtboxes set to barcode fonts.

All the same, it's working.

jpl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top