×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Barcoding from Access

Barcoding from Access

Barcoding from Access

(OP)
I want to print pricing barcodes from Access 2000. I have done a make table query to supply the data for a program called BarTender from Seagul. I want to be able to print the batch of barcodes in one go (hence the table) and then dump the data using a button on a form. Everything works fine, barcodes batch properly etc, and I can print them but when I return back to Access, I get the error message 438 that the object or method is not supported. How do I get rid of the error message. The code is: the last line is where it falls down (but it works anyway). Seagull supply an automation control which I have put in my references.

Private Sub Command115_Click()
Dim stDocName As String

    stDocName = "Barcode"
    DoCmd.RunMacro stDocName
    
Dim btApp As BarTender.Application

Set btApp = CreateObject("BarTender.Application")
Dim btFormat As New BarTender.Format
btApp.Visible = True
btFormat = btApp.Formats.Open("C:\My Documents\BarTender\Formats\bunnings.btw", False, "")

End Sub

I may have the wrong peice of code, as I used code form a VB.Net example.

Any ideas?

RE: Barcoding from Access

trap an error like so
code added to yours is in red

CODE

Private Sub Command115_Click()
On Error goto Err_Command115
    stDocName = "Barcode"
    DoCmd.RunMacro stDocName
    
Dim btApp As BarTender.Application

Set btApp = CreateObject("BarTender.Application")
Dim btFormat As New BarTender.Format
btApp.Visible = True
btFormat = btApp.Formats.Open("C:\My Documents\BarTender\Formats\bunnings.btw", False, "")
Exit_Command115:
Exit sub
Err_Command115:
Select case err.number
    ' case ####   'this is where your error number will go
    case else
        MsgBox "Error # " & Err.Number & "  " & Err.Description, vbInformation, "In sub Command115"
            
    End Select
    Resume Exit_Command115

End sub

Notice the REM character in front of Case ####
The first time you add this code and run it, a error box will pop up with the Error number. Note the Error number .
Then come back un-REM the Case #### put that number in place of  #### and run it again.
It should go on though with out a hitch unless it’s deeper internal than can be trapped here.

DougP, MCP, A+

RE: Barcoding from Access

(OP)
Thanks for your help Doug,

I'll give it go.

Dave

RE: Barcoding from Access

No Probs man, thanks for the star !!!

DougP, MCP, A+

RE: Barcoding from Access

BTW keep this Red code handy it works everywhere.
I got it from my code snippets I saved
just replace the Command115 with the name of the command button everywhere it exists. In any Sub or function for that matter.

Replace the CASE xxxx with whatever number you need to trap
also you can do other stuff with it as well.
When I'm debugging I also REM out the Exit like so

CODE

Resume ' Exit_Command115
then it will resume right to the line that has the problem and you can interrogate it further

DougP, MCP, A+

RE: Barcoding from Access

(OP)
Thanks for the tip and your help Doug, Much appreciated.

I got some VB6 code examples from Seagull, and I've got it working properly now. I needed to load BarTender in the background on Form Load, to make it work.

Have a great New Year

Dave

RE: Barcoding from Access

I just have a button on the form and call BarTender.  The label (LABEL1.btw) is designed to look at the access table via Odbc with a select statement.

Label select statement:
SELECT DISTINCT NurseryLibData.UPCode, NurseryLibData.CommonName, NurseryLibData.ItemName, NurseryLibData.BriefDescription, NurseryLibData.UnitPrice, NurseryLibData.[Sign line 3], NurseryLibData.[Sign line 4], NurseryLibData.[Sign line 5], NurseryLibData.[Sign line 6], NurseryLibData.[Sign line 7], NurseryLibData.[Sign line 8], NurseryLibData.QtySticky, NurseryLibData.Soil, NurseryLibData.Water
FROM NurseryLibData
WHERE (((NurseryLibData.QtySticky)>0))
ORDER BY NurseryLibData.ItemName;


Code behind button on form:

    Dim stAppName As String

stAppName = "C:\Progra~1\BarTen~1\bartend.exe /f=C:\Progra~1\BarTen~1\Accesslb\LABEL1.btw/FP/X"


    Call Shell(stAppName, 1)

RE: Barcoding from Access

I am working on an Inventory VB.net program that requires me to print barcodes by passing argument(barcode number) to a SUB to print barcode. I can create .btw file but I need to print the barcode number that is passed down form the main program to the sub which Command115_Click() in this case. How do I make the barcode number in the .btw to be a variable? How do I use the vbscript in the Modify Selected Barcode Object screen?

I appricate any help that you can provide me.
Thanks,
David

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close