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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error...Trouble w Code to print from Access to Loftware

Status
Not open for further replies.

ThatNewGuy

Technical User
Jan 19, 2007
47
US
I'm working with barcode software from Loftware and Access all at once. My objective is to enter information via a form in Access, but to click on a print button on this form that will print through Loftware which inturn will produce a series of barcodes, etc. on a label/form. Everthing in Loftware is set. I've tested it time and time again and it works accordingly. I'm running into a problem in Access, more specifically, when I select the command button on the form I receive a compile error: variable not defined. It highlights LLMX in gray on the third line of code below. Once I click on ok, it hightlights Private Sub cmdPrint_Click() in yellow. See code below.

Private Sub cmdPrint_Click()
'Sets which label format will be printed
LLMX.SetLabelName "T_REV.lwl"
'The next 4 "If" statements check to see if field is empty, if not, send the data to LLM-WIN
'1st field
If Me![txtPart #] <> "" Then
LLMX.SetData 0, Me![txtPart #]
Else
LLMX.SetData 0, ""
End If
'2nd field
If Me![txtRev] <> "" Then
LLMX.SetData 1, Me![txtRev]
Else
LLMX.SetData 1, ""
End If
'3rd field
If Me![txtDescription] <> "" Then
LLMX.SetData 2, Me![txtDescription]
Else
LLMX.SetData 2, ""
End If
'4th field
If Me![txtOrder Qty] <> "" Then
LLMX.SetData 3, Me![txtOrder Qty]
Else
LLMX.SetData 3, ""
End If
'If no quantity is entered, print 1 label (the default quantity)
If Me![txtQuantity] <> "" Then LLMX.Quantity = Me![txtQuantity]
'Issues print command to LLM-WIN
LLMX.Printlabel
End Sub

The bulk of the above coding was pulled from a sample database provided by Loftware that's where the LLMX and LLM-WIN were derived from.

Coding isn't my strong suit and I'm not sure what exactly I need to "declare" as a variable in order to fix this problem. I'm using an option explicit statement, I'm not sure if that's resulting in the declared variable issue. Is it something as simple as defining LLMX? Any assistance or clarification would be greatly appreciated.

Thanks!
 
Nevermind, I resolved the problem mentioned above. I had the incorrect directory selected. No wonder it wasn't reading the LLMX control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top