Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2007, 11:45 AM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA Object required - RTE 424

Hello,
I'm receiving a 424 RTE in the simple program that I've created in Access 2K3 SP2. The program is in a manufacturing environment. Here's an overview of the process: an operator will scan a 2D barcode, that input triggers an engraver to engrave the input onto metal. Then a verification camera takes a picture and verifies the mark to the original data.

I get the error code on the first line when trying to communicate with port COM1. The error line is in bold and if I comment our that line, it just gives the error on the next line and so on....
Here's the code:

Code:
Option Compare Database

Private Sub txtScanned_Input_AfterUpdate()
Dim strInput As String
strInput = txtScanned_Input

  
  Me.lblMessage.Caption = "WAITING ON ENGRAVER"   'Changes Display Message

DoCmd.RunSQL "INSERT INTO tblDOT_PEEN ([2D_DATA], [SCAN_DATE])" & _
        "VALUES (txtScanned_Input, DATE());"   'Stores barcode data and scan date


MSComm0.CommPort = 1  'Sets communication port to serial port Com1 - Dot Peen
        MSComm0.Settings = "19200,N,8,1,N"     'Declares Dot-Peen settings
        MSComm0.PortOpen = True    'Opens port for read/write capability
        MSComm0.Output = strInput       'Initiates marking sequence of 2D barcode
        MSComm0.PortOpen = False

    lblMessage.Caption = "CHECKING MARK"

'''''''''''''''
    cmdWAIT
'''''''''''''''

        MSComm1.CommPort = 2    'Sets communication port to serial com2 - Congnex imager
        MSComm1.PortOpen = True     'Opens port for read capability
        MSComm1.Input = strInput    'Passes scanned data to imager


    If MSComm1.Input = MSComm0.Output Then
    ]Me.lblMessage.Caption = "GOOD MARK!"
    Else
       MsgBox "Bad Mark! Please contact your manager", vbOKCancel, "Marking Error"
    End If

''''''''''''''
    cmdRESET
''''''''''''''

          
End Sub

Public Sub cmdWAIT()

Dim PauseTime, Start, Finish, TotalTime

    PauseTime = 2   ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop

End Sub

Public Sub cmdRESET()

strInput = ""
strDP_Result = ""
lblMessage.Caption = "LOAD BODY AND SCAN CORE BARCODE"


End Sub


End Sub

Any help, tips, links, or info would be greatly appreciated.
Thanks in advance!
  #2 (permalink)  
Old November 2nd, 2007, 03:36 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

My screen is set to 1280 × 1024, and I need to use 2 screen widths to view this question.
Why would you make things that hard for those you want to help you?
Please edit this question, and make it a little narrower.

Even if you cannot change the code part, at least you could insert carriage returns into
the non-code parts.
  #3 (permalink)  
Old November 2nd, 2007, 04:06 PM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm very sorry. I hadn't realized that the formatting was so badly disturbed when pasting directly from VB.

Anywho, I have it figured out. I didn't have the control on the form. I didn't know it was required to use the ActiveX controls on the form when calling the MSComm methods.

Thanks for the heads up about the format and for the potential help!

Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Error 424 "Object Required" paul31berks Access VBA 8 October 31st, 2010 04:49 PM
Runtime Error 424: Object needed tobian Excel VBA 4 February 20th, 2006 10:41 AM
object required alitoday Classic ASP Components 1 December 28th, 2004 01:17 AM
object required shoakat Classic ASP Databases 7 November 23rd, 2004 07:38 PM



All times are GMT -4. The time now is 01:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.