Object not defined

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cmdolcet69

    #1

    Object not defined

    I have a form that will log a serial print number into a object once
    sampled.I call a new form when my users samples the value and on the
    new form it will give me an option to reprint the serial number, what
    happens is that when i get to the new form it will trigger an error
    object reference not set to an instance of an object.

    The Public scantuntime as frmnewruntime is the original form where i
    hot the sample button on the form. Once the sample button is pushed it
    will call the PrintBarcodeLab el (). If the barcode is wrong then I
    want to reprint the bar code which i call it in the
    scanruntime.Pri ntBarcodeLabel( ). But i get the above error, how can i
    avoid this?



    Public Class dlgBarCodeScann er
    Public scanruntime As frmNewRuntime
    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
    As System.EventArg s) Handles Button1.Click
    scanruntime.Pri ntBarcodeLabel( )
    End Sub
    End Class
  • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

    #2
    RE: Object not defined



    "cmdolcet69 " wrote:
    I have a form that will log a serial print number into a object once
    sampled.I call a new form when my users samples the value and on the
    new form it will give me an option to reprint the serial number, what
    happens is that when i get to the new form it will trigger an error
    object reference not set to an instance of an object.
    >
    The Public scantuntime as frmnewruntime is the original form where i
    hot the sample button on the form. Once the sample button is pushed it
    will call the PrintBarcodeLab el (). If the barcode is wrong then I
    want to reprint the bar code which i call it in the
    scanruntime.Pri ntBarcodeLabel( ). But i get the above error, how can i
    avoid this?
    >
    >
    >
    Public Class dlgBarCodeScann er
    Public scanruntime As frmNewRuntime
    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
    As System.EventArg s) Handles Button1.Click
    scanruntime.Pri ntBarcodeLabel( )
    End Sub
    End Class
    >
    You don't show where you are setting scanruntime to an object. You should
    be doing "something" like this:

    dim ui as New dlgBarCodeScann er
    ui.scanruntime = SomeUIObject ' I don't know what you want it set to...
    ui.Show()


    Comment

    Working...