Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Invalid Data Format

Discussion in 'Information Technology' started by tb, Jul 28, 2006.

  1. tb

    tb
    Expand Collapse
    Guest

    I took over a database from someone ca. one year ago. Since then, I have had
    various problems with it. My most recent and difficult is "Invalid Data
    Format". Sometimes when can enter the database and click on a command button,
    the message appears opening VB, highlighting a specific code, i.e.

    Private Sub cmd_Add_CO_Amendment_Click()

    The next time I enter the DB and click on the same command button, I receive
    no error message. Sometimes I must enter 3-4x before I receive no error.

    I have had several people look at the code and no one has been able to
    figure out what the problem is. So, any assistance would be greatly
    appreciated.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikh rendered invalid in ’84 riots seeks justice (Gulf Times) Breaking News Mar 14, 2008
    Sikh News 23 years later, invalid Sikh seeks justice (Calcutta News) Breaking News Mar 13, 2008
    Sikh News 23 years later, invalid Sikh seeks justice (New Kerala) Breaking News Mar 13, 2008
    Sikh News 23 years later, invalid Sikh seeks justice (Hindustan Times) Breaking News Mar 13, 2008
    Datawind's Sunseet Singh Introduces Ubislate: Aimed at the Cost-Conscious World Sikh Personalities Jan 12, 2014

  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Please post the code in cmd_Add_CO_Amendment_Click


    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    tb wrote:
    > I took over a database from someone ca. one year ago. Since then, I have had
    > various problems with it. My most recent and difficult is "Invalid Data
    > Format". Sometimes when can enter the database and click on a command button,
    > the message appears opening VB, highlighting a specific code, i.e.
    >
    > Private Sub cmd_Add_CO_Amendment_Click()
    >
    > The next time I enter the DB and click on the same command button, I receive
    > no error message. Sometimes I must enter 3-4x before I receive no error.
    >
    > I have had several people look at the code and no one has been able to
    > figure out what the problem is. So, any assistance would be greatly
    > appreciated.
    >
    >
     
  4. tb

    tb
    Expand Collapse
    Guest

    The full code is as follows:

    Private Sub cmd_Add_CO_Amendment_Click()
    On Error GoTo Err_cmd_Add_CO_Amendment_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "fmnu_Add_CO_By_Project"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_cmd_Add_CO_Amendment_Click:
    Exit Sub

    Err_cmd_Add_CO_Amendment_Click:
    MsgBox Err.Description
    Resume Exit_cmd_Add_CO_Amendment_Click

    End Sub

    tb

    "strive4peace" <"strive4peace2006 at yaho" wrote:

    > Please post the code in cmd_Add_CO_Amendment_Click
    >
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > tb wrote:
    > > I took over a database from someone ca. one year ago. Since then, I have had
    > > various problems with it. My most recent and difficult is "Invalid Data
    > > Format". Sometimes when can enter the database and click on a command button,
    > > the message appears opening VB, highlighting a specific code, i.e.
    > >
    > > Private Sub cmd_Add_CO_Amendment_Click()
    > >
    > > The next time I enter the DB and click on the same command button, I receive
    > > no error message. Sometimes I must enter 3-4x before I receive no error.
    > >
    > > I have had several people look at the code and no one has been able to
    > > figure out what the problem is. So, any assistance would be greatly
    > > appreciated.
    > >
    > >

    >
     
  5. strive4peace

    strive4peace
    Expand Collapse
    Guest

    since you are opening a form, that is where the error must be

    A possible source for your error may be a calculated control
    that makes reference to a control than sometimes contains a
    null value (that explains the sporadic problems)

    in an equation, you can wrap a control reference with NZ to
    avoid this problem

    example:

    =(nz([Sales]) - nz([Cost]))

    If that isn't it, is there any code behind
    fmnu_Add_CO_By_Project? If so, can you post it?


    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    tb wrote:
    > The full code is as follows:
    >
    > Private Sub cmd_Add_CO_Amendment_Click()
    > On Error GoTo Err_cmd_Add_CO_Amendment_Click
    >
    > Dim stDocName As String
    > Dim stLinkCriteria As String
    >
    > stDocName = "fmnu_Add_CO_By_Project"
    > DoCmd.OpenForm stDocName, , , stLinkCriteria
    >
    > Exit_cmd_Add_CO_Amendment_Click:
    > Exit Sub
    >
    > Err_cmd_Add_CO_Amendment_Click:
    > MsgBox Err.Description
    > Resume Exit_cmd_Add_CO_Amendment_Click
    >
    > End Sub
    >
    > tb
    >
    > "strive4peace" <"strive4peace2006 at yaho" wrote:
    >
    >
    >>Please post the code in cmd_Add_CO_Amendment_Click
    >>
    >>
    >>Warm Regards,
    >>Crystal
    >>Microsoft Access MVP 2006
    >>
    >> *
    >> Have an awesome day ;)
    >>
    >> remote programming and training
    >> strive4peace2006 at yahoo.com
    >>
    >> *
    >>
    >>tb wrote:
    >>
    >>>I took over a database from someone ca. one year ago. Since then, I have had
    >>>various problems with it. My most recent and difficult is "Invalid Data
    >>>Format". Sometimes when can enter the database and click on a command button,
    >>>the message appears opening VB, highlighting a specific code, i.e.
    >>>
    >>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>
    >>>The next time I enter the DB and click on the same command button, I receive
    >>>no error message. Sometimes I must enter 3-4x before I receive no error.
    >>>
    >>>I have had several people look at the code and no one has been able to
    >>>figure out what the problem is. So, any assistance would be greatly
    >>>appreciated.
    >>>
    >>>

    >>
     
  6. tb

    tb
    Expand Collapse
    Guest

    The code on the form is:

    Private Sub Agt_Type_AfterUpdate()

    Me.Refresh

    End Sub

    Private Sub cmd_close_frm_Click()
    On Error GoTo Err_cmd_close_frm_Click

    DoCmd.Close

    Exit_cmd_close_frm_Click:
    Exit Sub

    Err_cmd_close_frm_Click:
    MsgBox Err.Description
    Resume Exit_cmd_close_frm_Click
    End Sub

    Private Sub Form_Activate()
    Me.Refresh
    End Sub

    Private Sub Form_Current()

    If IsNull(Me.OpenArgs) = False Then
    Me.lblOpenArg.Caption = Me.OpenArgs
    End If

    'Me.Requery

    End Sub

    This is not an error I receive solely with this form. It does occur only
    with command buttons, and becomes worse after I syncronize with replicas.

    tb


    "strive4peace" <"strive4peace2006 at yaho" wrote:

    > since you are opening a form, that is where the error must be
    >
    > A possible source for your error may be a calculated control
    > that makes reference to a control than sometimes contains a
    > null value (that explains the sporadic problems)
    >
    > in an equation, you can wrap a control reference with NZ to
    > avoid this problem
    >
    > example:
    >
    > =(nz([Sales]) - nz([Cost]))
    >
    > If that isn't it, is there any code behind
    > fmnu_Add_CO_By_Project? If so, can you post it?
    >
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > tb wrote:
    > > The full code is as follows:
    > >
    > > Private Sub cmd_Add_CO_Amendment_Click()
    > > On Error GoTo Err_cmd_Add_CO_Amendment_Click
    > >
    > > Dim stDocName As String
    > > Dim stLinkCriteria As String
    > >
    > > stDocName = "fmnu_Add_CO_By_Project"
    > > DoCmd.OpenForm stDocName, , , stLinkCriteria
    > >
    > > Exit_cmd_Add_CO_Amendment_Click:
    > > Exit Sub
    > >
    > > Err_cmd_Add_CO_Amendment_Click:
    > > MsgBox Err.Description
    > > Resume Exit_cmd_Add_CO_Amendment_Click
    > >
    > > End Sub
    > >
    > > tb
    > >
    > > "strive4peace" <"strive4peace2006 at yaho" wrote:
    > >
    > >
    > >>Please post the code in cmd_Add_CO_Amendment_Click
    > >>
    > >>
    > >>Warm Regards,
    > >>Crystal
    > >>Microsoft Access MVP 2006
    > >>
    > >> *
    > >> Have an awesome day ;)
    > >>
    > >> remote programming and training
    > >> strive4peace2006 at yahoo.com
    > >>
    > >> *
    > >>
    > >>tb wrote:
    > >>
    > >>>I took over a database from someone ca. one year ago. Since then, I have had
    > >>>various problems with it. My most recent and difficult is "Invalid Data
    > >>>Format". Sometimes when can enter the database and click on a command button,
    > >>>the message appears opening VB, highlighting a specific code, i.e.
    > >>>
    > >>>Private Sub cmd_Add_CO_Amendment_Click()
    > >>>
    > >>>The next time I enter the DB and click on the same command button, I receive
    > >>>no error message. Sometimes I must enter 3-4x before I receive no error.
    > >>>
    > >>>I have had several people look at the code and no one has been able to
    > >>>figure out what the problem is. So, any assistance would be greatly
    > >>>appreciated.
    > >>>
    > >>>
    > >>

    >
     
  7. strive4peace

    strive4peace
    Expand Collapse
    Guest

    rather than

    If IsNull(Me.OpenArgs) = False Then
    Me.lblOpenArg.Caption = Me.OpenArgs
    End If

    try

    If Len(nz(Me.OpenArgs,"")) > 0 Then
    Me.lblOpenArg.Caption = Me.OpenArgs
    End If

    why are you doing this on the Current event?


    when you say: "It does occur only with command buttons" do
    you mean that the error doesn't happen if you open the form
    from the database window, but it does when you open it
    from another form?

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    tb wrote:
    > The code on the form is:
    >
    > Private Sub Agt_Type_AfterUpdate()
    >
    > Me.Refresh
    >
    > End Sub
    >
    > Private Sub cmd_close_frm_Click()
    > On Error GoTo Err_cmd_close_frm_Click
    >
    > DoCmd.Close
    >
    > Exit_cmd_close_frm_Click:
    > Exit Sub
    >
    > Err_cmd_close_frm_Click:
    > MsgBox Err.Description
    > Resume Exit_cmd_close_frm_Click
    > End Sub
    >
    > Private Sub Form_Activate()
    > Me.Refresh
    > End Sub
    >
    > Private Sub Form_Current()
    >
    > If IsNull(Me.OpenArgs) = False Then
    > Me.lblOpenArg.Caption = Me.OpenArgs
    > End If
    >
    > 'Me.Requery
    >
    > End Sub
    >
    > This is not an error I receive solely with this form. It does occur only
    > with command buttons, and becomes worse after I syncronize with replicas.
    >
    > tb
    >
    >
    > "strive4peace" <"strive4peace2006 at yaho" wrote:
    >
    >
    >>since you are opening a form, that is where the error must be
    >>
    >>A possible source for your error may be a calculated control
    >>that makes reference to a control than sometimes contains a
    >>null value (that explains the sporadic problems)
    >>
    >>in an equation, you can wrap a control reference with NZ to
    >>avoid this problem
    >>
    >>example:
    >>
    >>=(nz([Sales]) - nz([Cost]))
    >>
    >>If that isn't it, is there any code behind
    >>fmnu_Add_CO_By_Project? If so, can you post it?
    >>
    >>
    >>Warm Regards,
    >>Crystal
    >>Microsoft Access MVP 2006
    >>
    >> *
    >> Have an awesome day ;)
    >>
    >> remote programming and training
    >> strive4peace2006 at yahoo.com
    >>
    >> *
    >>
    >>tb wrote:
    >>
    >>>The full code is as follows:
    >>>
    >>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>On Error GoTo Err_cmd_Add_CO_Amendment_Click
    >>>
    >>> Dim stDocName As String
    >>> Dim stLinkCriteria As String
    >>>
    >>> stDocName = "fmnu_Add_CO_By_Project"
    >>> DoCmd.OpenForm stDocName, , , stLinkCriteria
    >>>
    >>>Exit_cmd_Add_CO_Amendment_Click:
    >>> Exit Sub
    >>>
    >>>Err_cmd_Add_CO_Amendment_Click:
    >>> MsgBox Err.Description
    >>> Resume Exit_cmd_Add_CO_Amendment_Click
    >>>
    >>>End Sub
    >>>
    >>>tb
    >>>
    >>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    >>>
    >>>
    >>>
    >>>>Please post the code in cmd_Add_CO_Amendment_Click
    >>>>
    >>>>
    >>>>Warm Regards,
    >>>>Crystal
    >>>>Microsoft Access MVP 2006
    >>>>
    >>>> *
    >>>> Have an awesome day ;)
    >>>>
    >>>> remote programming and training
    >>>> strive4peace2006 at yahoo.com
    >>>>
    >>>> *
    >>>>
    >>>>tb wrote:
    >>>>
    >>>>
    >>>>>I took over a database from someone ca. one year ago. Since then, I have had
    >>>>>various problems with it. My most recent and difficult is "Invalid Data
    >>>>>Format". Sometimes when can enter the database and click on a command button,
    >>>>>the message appears opening VB, highlighting a specific code, i.e.
    >>>>>
    >>>>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>>>
    >>>>>The next time I enter the DB and click on the same command button, I receive
    >>>>>no error message. Sometimes I must enter 3-4x before I receive no error.
    >>>>>
    >>>>>I have had several people look at the code and no one has been able to
    >>>>>figure out what the problem is. So, any assistance would be greatly
    >>>>>appreciated.
    >>>>>
    >>>>>
    >>>>
     
  8. tb

    tb
    Expand Collapse
    Guest

    My bad, it does occur when I open the form from the db window.

    tb

    "strive4peace" <"strive4peace2006 at yaho" wrote:

    > rather than
    >
    > If IsNull(Me.OpenArgs) = False Then
    > Me.lblOpenArg.Caption = Me.OpenArgs
    > End If
    >
    > try
    >
    > If Len(nz(Me.OpenArgs,"")) > 0 Then
    > Me.lblOpenArg.Caption = Me.OpenArgs
    > End If
    >
    > why are you doing this on the Current event?
    >
    >
    > when you say: "It does occur only with command buttons" do
    > you mean that the error doesn't happen if you open the form
    > from the database window, but it does when you open it
    > from another form?
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > tb wrote:
    > > The code on the form is:
    > >
    > > Private Sub Agt_Type_AfterUpdate()
    > >
    > > Me.Refresh
    > >
    > > End Sub
    > >
    > > Private Sub cmd_close_frm_Click()
    > > On Error GoTo Err_cmd_close_frm_Click
    > >
    > > DoCmd.Close
    > >
    > > Exit_cmd_close_frm_Click:
    > > Exit Sub
    > >
    > > Err_cmd_close_frm_Click:
    > > MsgBox Err.Description
    > > Resume Exit_cmd_close_frm_Click
    > > End Sub
    > >
    > > Private Sub Form_Activate()
    > > Me.Refresh
    > > End Sub
    > >
    > > Private Sub Form_Current()
    > >
    > > If IsNull(Me.OpenArgs) = False Then
    > > Me.lblOpenArg.Caption = Me.OpenArgs
    > > End If
    > >
    > > 'Me.Requery
    > >
    > > End Sub
    > >
    > > This is not an error I receive solely with this form. It does occur only
    > > with command buttons, and becomes worse after I syncronize with replicas.
    > >
    > > tb
    > >
    > >
    > > "strive4peace" <"strive4peace2006 at yaho" wrote:
    > >
    > >
    > >>since you are opening a form, that is where the error must be
    > >>
    > >>A possible source for your error may be a calculated control
    > >>that makes reference to a control than sometimes contains a
    > >>null value (that explains the sporadic problems)
    > >>
    > >>in an equation, you can wrap a control reference with NZ to
    > >>avoid this problem
    > >>
    > >>example:
    > >>
    > >>=(nz([Sales]) - nz([Cost]))
    > >>
    > >>If that isn't it, is there any code behind
    > >>fmnu_Add_CO_By_Project? If so, can you post it?
    > >>
    > >>
    > >>Warm Regards,
    > >>Crystal
    > >>Microsoft Access MVP 2006
    > >>
    > >> *
    > >> Have an awesome day ;)
    > >>
    > >> remote programming and training
    > >> strive4peace2006 at yahoo.com
    > >>
    > >> *
    > >>
    > >>tb wrote:
    > >>
    > >>>The full code is as follows:
    > >>>
    > >>>Private Sub cmd_Add_CO_Amendment_Click()
    > >>>On Error GoTo Err_cmd_Add_CO_Amendment_Click
    > >>>
    > >>> Dim stDocName As String
    > >>> Dim stLinkCriteria As String
    > >>>
    > >>> stDocName = "fmnu_Add_CO_By_Project"
    > >>> DoCmd.OpenForm stDocName, , , stLinkCriteria
    > >>>
    > >>>Exit_cmd_Add_CO_Amendment_Click:
    > >>> Exit Sub
    > >>>
    > >>>Err_cmd_Add_CO_Amendment_Click:
    > >>> MsgBox Err.Description
    > >>> Resume Exit_cmd_Add_CO_Amendment_Click
    > >>>
    > >>>End Sub
    > >>>
    > >>>tb
    > >>>
    > >>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    > >>>
    > >>>
    > >>>
    > >>>>Please post the code in cmd_Add_CO_Amendment_Click
    > >>>>
    > >>>>
    > >>>>Warm Regards,
    > >>>>Crystal
    > >>>>Microsoft Access MVP 2006
    > >>>>
    > >>>> *
    > >>>> Have an awesome day ;)
    > >>>>
    > >>>> remote programming and training
    > >>>> strive4peace2006 at yahoo.com
    > >>>>
    > >>>> *
    > >>>>
    > >>>>tb wrote:
    > >>>>
    > >>>>
    > >>>>>I took over a database from someone ca. one year ago. Since then, I have had
    > >>>>>various problems with it. My most recent and difficult is "Invalid Data
    > >>>>>Format". Sometimes when can enter the database and click on a command button,
    > >>>>>the message appears opening VB, highlighting a specific code, i.e.
    > >>>>>
    > >>>>>Private Sub cmd_Add_CO_Amendment_Click()
    > >>>>>
    > >>>>>The next time I enter the DB and click on the same command button, I receive
    > >>>>>no error message. Sometimes I must enter 3-4x before I receive no error.
    > >>>>>
    > >>>>>I have had several people look at the code and no one has been able to
    > >>>>>figure out what the problem is. So, any assistance would be greatly
    > >>>>>appreciated.
    > >>>>>
    > >>>>>
    > >>>>

    >
     
  9. strive4peace

    strive4peace
    Expand Collapse
    Guest

    What version of Access are you using?

    and, to ask again, why are you doing this on the Current event?

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    tb wrote:
    > My bad, it does occur when I open the form from the db window.
    >
    > tb
    >
    > "strive4peace" <"strive4peace2006 at yaho" wrote:
    >
    >
    >>rather than
    >>
    >> If IsNull(Me.OpenArgs) = False Then
    >> Me.lblOpenArg.Caption = Me.OpenArgs
    >> End If
    >>
    >>try
    >>
    >> If Len(nz(Me.OpenArgs,"")) > 0 Then
    >> Me.lblOpenArg.Caption = Me.OpenArgs
    >> End If
    >>
    >>why are you doing this on the Current event?
    >>
    >>
    >>when you say: "It does occur only with command buttons" do
    >>you mean that the error doesn't happen if you open the form
    >> from the database window, but it does when you open it
    >>from another form?
    >>
    >>Warm Regards,
    >>Crystal
    >>Microsoft Access MVP 2006
    >>
    >> *
    >> Have an awesome day ;)
    >>
    >> remote programming and training
    >> strive4peace2006 at yahoo.com
    >>
    >> *
    >>
    >>tb wrote:
    >>
    >>>The code on the form is:
    >>>
    >>>Private Sub Agt_Type_AfterUpdate()
    >>>
    >>> Me.Refresh
    >>>
    >>>End Sub
    >>>
    >>>Private Sub cmd_close_frm_Click()
    >>>On Error GoTo Err_cmd_close_frm_Click
    >>>
    >>> DoCmd.Close
    >>>
    >>>Exit_cmd_close_frm_Click:
    >>> Exit Sub
    >>>
    >>>Err_cmd_close_frm_Click:
    >>> MsgBox Err.Description
    >>> Resume Exit_cmd_close_frm_Click
    >>>End Sub
    >>>
    >>>Private Sub Form_Activate()
    >>> Me.Refresh
    >>>End Sub
    >>>
    >>>Private Sub Form_Current()
    >>>
    >>> If IsNull(Me.OpenArgs) = False Then
    >>> Me.lblOpenArg.Caption = Me.OpenArgs
    >>> End If
    >>>
    >>> 'Me.Requery
    >>>
    >>>End Sub
    >>>
    >>>This is not an error I receive solely with this form. It does occur only
    >>>with command buttons, and becomes worse after I syncronize with replicas.
    >>>
    >>>tb
    >>>
    >>>
    >>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    >>>
    >>>
    >>>
    >>>>since you are opening a form, that is where the error must be
    >>>>
    >>>>A possible source for your error may be a calculated control
    >>>>that makes reference to a control than sometimes contains a
    >>>>null value (that explains the sporadic problems)
    >>>>
    >>>>in an equation, you can wrap a control reference with NZ to
    >>>>avoid this problem
    >>>>
    >>>>example:
    >>>>
    >>>>=(nz([Sales]) - nz([Cost]))
    >>>>
    >>>>If that isn't it, is there any code behind
    >>>>fmnu_Add_CO_By_Project? If so, can you post it?
    >>>>
    >>>>
    >>>>Warm Regards,
    >>>>Crystal
    >>>>Microsoft Access MVP 2006
    >>>>
    >>>> *
    >>>> Have an awesome day ;)
    >>>>
    >>>> remote programming and training
    >>>> strive4peace2006 at yahoo.com
    >>>>
    >>>> *
    >>>>
    >>>>tb wrote:
    >>>>
    >>>>
    >>>>>The full code is as follows:
    >>>>>
    >>>>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>>>On Error GoTo Err_cmd_Add_CO_Amendment_Click
    >>>>>
    >>>>> Dim stDocName As String
    >>>>> Dim stLinkCriteria As String
    >>>>>
    >>>>> stDocName = "fmnu_Add_CO_By_Project"
    >>>>> DoCmd.OpenForm stDocName, , , stLinkCriteria
    >>>>>
    >>>>>Exit_cmd_Add_CO_Amendment_Click:
    >>>>> Exit Sub
    >>>>>
    >>>>>Err_cmd_Add_CO_Amendment_Click:
    >>>>> MsgBox Err.Description
    >>>>> Resume Exit_cmd_Add_CO_Amendment_Click
    >>>>>
    >>>>>End Sub
    >>>>>
    >>>>>tb
    >>>>>
    >>>>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>>>Please post the code in cmd_Add_CO_Amendment_Click
    >>>>>>
    >>>>>>
    >>>>>>Warm Regards,
    >>>>>>Crystal
    >>>>>>Microsoft Access MVP 2006
    >>>>>>
    >>>>>>*
    >>>>>> Have an awesome day ;)
    >>>>>>
    >>>>>> remote programming and training
    >>>>>> strive4peace2006 at yahoo.com
    >>>>>>
    >>>>>>*
    >>>>>>
    >>>>>>tb wrote:
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>>I took over a database from someone ca. one year ago. Since then, I have had
    >>>>>>>various problems with it. My most recent and difficult is "Invalid Data
    >>>>>>>Format". Sometimes when can enter the database and click on a command button,
    >>>>>>>the message appears opening VB, highlighting a specific code, i.e.
    >>>>>>>
    >>>>>>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>>>>>
    >>>>>>>The next time I enter the DB and click on the same command button, I receive
    >>>>>>>no error message. Sometimes I must enter 3-4x before I receive no error.
    >>>>>>>
    >>>>>>>I have had several people look at the code and no one has been able to
    >>>>>>>figure out what the problem is. So, any assistance would be greatly
    >>>>>>>appreciated.
    >>>>>>>
    >>>>>>>
    >>>>>>
     
  10. tb

    tb
    Expand Collapse
    Guest

    2003 version. What do you mean, why am I doing this on the current event?//tb

    "strive4peace" <"strive4peace2006 at yaho" wrote:

    > What version of Access are you using?
    >
    > and, to ask again, why are you doing this on the Current event?
    >
    > Warm Regards,
    > Crystal
    > Microsoft Access MVP 2006
    >
    > *
    > Have an awesome day ;)
    >
    > remote programming and training
    > strive4peace2006 at yahoo.com
    >
    > *
    >
    > tb wrote:
    > > My bad, it does occur when I open the form from the db window.
    > >
    > > tb
    > >
    > > "strive4peace" <"strive4peace2006 at yaho" wrote:
    > >
    > >
    > >>rather than
    > >>
    > >> If IsNull(Me.OpenArgs) = False Then
    > >> Me.lblOpenArg.Caption = Me.OpenArgs
    > >> End If
    > >>
    > >>try
    > >>
    > >> If Len(nz(Me.OpenArgs,"")) > 0 Then
    > >> Me.lblOpenArg.Caption = Me.OpenArgs
    > >> End If
    > >>
    > >>why are you doing this on the Current event?
    > >>
    > >>
    > >>when you say: "It does occur only with command buttons" do
    > >>you mean that the error doesn't happen if you open the form
    > >> from the database window, but it does when you open it
    > >>from another form?
    > >>
    > >>Warm Regards,
    > >>Crystal
    > >>Microsoft Access MVP 2006
    > >>
    > >> *
    > >> Have an awesome day ;)
    > >>
    > >> remote programming and training
    > >> strive4peace2006 at yahoo.com
    > >>
    > >> *
    > >>
    > >>tb wrote:
    > >>
    > >>>The code on the form is:
    > >>>
    > >>>Private Sub Agt_Type_AfterUpdate()
    > >>>
    > >>> Me.Refresh
    > >>>
    > >>>End Sub
    > >>>
    > >>>Private Sub cmd_close_frm_Click()
    > >>>On Error GoTo Err_cmd_close_frm_Click
    > >>>
    > >>> DoCmd.Close
    > >>>
    > >>>Exit_cmd_close_frm_Click:
    > >>> Exit Sub
    > >>>
    > >>>Err_cmd_close_frm_Click:
    > >>> MsgBox Err.Description
    > >>> Resume Exit_cmd_close_frm_Click
    > >>>End Sub
    > >>>
    > >>>Private Sub Form_Activate()
    > >>> Me.Refresh
    > >>>End Sub
    > >>>
    > >>>Private Sub Form_Current()
    > >>>
    > >>> If IsNull(Me.OpenArgs) = False Then
    > >>> Me.lblOpenArg.Caption = Me.OpenArgs
    > >>> End If
    > >>>
    > >>> 'Me.Requery
    > >>>
    > >>>End Sub
    > >>>
    > >>>This is not an error I receive solely with this form. It does occur only
    > >>>with command buttons, and becomes worse after I syncronize with replicas.
    > >>>
    > >>>tb
    > >>>
    > >>>
    > >>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    > >>>
    > >>>
    > >>>
    > >>>>since you are opening a form, that is where the error must be
    > >>>>
    > >>>>A possible source for your error may be a calculated control
    > >>>>that makes reference to a control than sometimes contains a
    > >>>>null value (that explains the sporadic problems)
    > >>>>
    > >>>>in an equation, you can wrap a control reference with NZ to
    > >>>>avoid this problem
    > >>>>
    > >>>>example:
    > >>>>
    > >>>>=(nz([Sales]) - nz([Cost]))
    > >>>>
    > >>>>If that isn't it, is there any code behind
    > >>>>fmnu_Add_CO_By_Project? If so, can you post it?
    > >>>>
    > >>>>
    > >>>>Warm Regards,
    > >>>>Crystal
    > >>>>Microsoft Access MVP 2006
    > >>>>
    > >>>> *
    > >>>> Have an awesome day ;)
    > >>>>
    > >>>> remote programming and training
    > >>>> strive4peace2006 at yahoo.com
    > >>>>
    > >>>> *
    > >>>>
    > >>>>tb wrote:
    > >>>>
    > >>>>
    > >>>>>The full code is as follows:
    > >>>>>
    > >>>>>Private Sub cmd_Add_CO_Amendment_Click()
    > >>>>>On Error GoTo Err_cmd_Add_CO_Amendment_Click
    > >>>>>
    > >>>>> Dim stDocName As String
    > >>>>> Dim stLinkCriteria As String
    > >>>>>
    > >>>>> stDocName = "fmnu_Add_CO_By_Project"
    > >>>>> DoCmd.OpenForm stDocName, , , stLinkCriteria
    > >>>>>
    > >>>>>Exit_cmd_Add_CO_Amendment_Click:
    > >>>>> Exit Sub
    > >>>>>
    > >>>>>Err_cmd_Add_CO_Amendment_Click:
    > >>>>> MsgBox Err.Description
    > >>>>> Resume Exit_cmd_Add_CO_Amendment_Click
    > >>>>>
    > >>>>>End Sub
    > >>>>>
    > >>>>>tb
    > >>>>>
    > >>>>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    > >>>>>
    > >>>>>
    > >>>>>
    > >>>>>
    > >>>>>>Please post the code in cmd_Add_CO_Amendment_Click
    > >>>>>>
    > >>>>>>
    > >>>>>>Warm Regards,
    > >>>>>>Crystal
    > >>>>>>Microsoft Access MVP 2006
    > >>>>>>
    > >>>>>>*
    > >>>>>> Have an awesome day ;)
    > >>>>>>
    > >>>>>> remote programming and training
    > >>>>>> strive4peace2006 at yahoo.com
    > >>>>>>
    > >>>>>>*
    > >>>>>>
    > >>>>>>tb wrote:
    > >>>>>>
    > >>>>>>
    > >>>>>>
    > >>>>>>>I took over a database from someone ca. one year ago. Since then, I have had
    > >>>>>>>various problems with it. My most recent and difficult is "Invalid Data
    > >>>>>>>Format". Sometimes when can enter the database and click on a command button,
    > >>>>>>>the message appears opening VB, highlighting a specific code, i.e.
    > >>>>>>>
    > >>>>>>>Private Sub cmd_Add_CO_Amendment_Click()
    > >>>>>>>
    > >>>>>>>The next time I enter the DB and click on the same command button, I receive
    > >>>>>>>no error message. Sometimes I must enter 3-4x before I receive no error.
    > >>>>>>>
    > >>>>>>>I have had several people look at the code and no one has been able to
    > >>>>>>>figure out what the problem is. So, any assistance would be greatly
    > >>>>>>>appreciated.
    > >>>>>>>
    > >>>>>>>
    > >>>>>>

    >
     
  11. strive4peace

    strive4peace
    Expand Collapse
    Guest

    the Current event is executed each time the record is
    changed. You are setting a caption based on the OpenArgs
    and that would only need to be done one time -- the LOAD
    event might be a more appropriate place to put the code

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    tb wrote:
    > 2003 version. What do you mean, why am I doing this on the current event?//tb
    >
    > "strive4peace" <"strive4peace2006 at yaho" wrote:
    >
    >
    >>What version of Access are you using?
    >>
    >>and, to ask again, why are you doing this on the Current event?
    >>
    >>Warm Regards,
    >>Crystal
    >>Microsoft Access MVP 2006
    >>
    >> *
    >> Have an awesome day ;)
    >>
    >> remote programming and training
    >> strive4peace2006 at yahoo.com
    >>
    >> *
    >>
    >>tb wrote:
    >>
    >>>My bad, it does occur when I open the form from the db window.
    >>>
    >>>tb
    >>>
    >>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    >>>
    >>>
    >>>
    >>>>rather than
    >>>>
    >>>> If IsNull(Me.OpenArgs) = False Then
    >>>> Me.lblOpenArg.Caption = Me.OpenArgs
    >>>> End If
    >>>>
    >>>>try
    >>>>
    >>>> If Len(nz(Me.OpenArgs,"")) > 0 Then
    >>>> Me.lblOpenArg.Caption = Me.OpenArgs
    >>>> End If
    >>>>
    >>>>why are you doing this on the Current event?
    >>>>
    >>>>
    >>>>when you say: "It does occur only with command buttons" do
    >>>>you mean that the error doesn't happen if you open the form
    >>>> from the database window, but it does when you open it
    >>>
    >>>>from another form?
    >>>
    >>>>Warm Regards,
    >>>>Crystal
    >>>>Microsoft Access MVP 2006
    >>>>
    >>>> *
    >>>> Have an awesome day ;)
    >>>>
    >>>> remote programming and training
    >>>> strive4peace2006 at yahoo.com
    >>>>
    >>>> *
    >>>>
    >>>>tb wrote:
    >>>>
    >>>>
    >>>>>The code on the form is:
    >>>>>
    >>>>>Private Sub Agt_Type_AfterUpdate()
    >>>>>
    >>>>> Me.Refresh
    >>>>>
    >>>>>End Sub
    >>>>>
    >>>>>Private Sub cmd_close_frm_Click()
    >>>>>On Error GoTo Err_cmd_close_frm_Click
    >>>>>
    >>>>> DoCmd.Close
    >>>>>
    >>>>>Exit_cmd_close_frm_Click:
    >>>>> Exit Sub
    >>>>>
    >>>>>Err_cmd_close_frm_Click:
    >>>>> MsgBox Err.Description
    >>>>> Resume Exit_cmd_close_frm_Click
    >>>>>End Sub
    >>>>>
    >>>>>Private Sub Form_Activate()
    >>>>> Me.Refresh
    >>>>>End Sub
    >>>>>
    >>>>>Private Sub Form_Current()
    >>>>>
    >>>>> If IsNull(Me.OpenArgs) = False Then
    >>>>> Me.lblOpenArg.Caption = Me.OpenArgs
    >>>>> End If
    >>>>>
    >>>>> 'Me.Requery
    >>>>>
    >>>>>End Sub
    >>>>>
    >>>>>This is not an error I receive solely with this form. It does occur only
    >>>>>with command buttons, and becomes worse after I syncronize with replicas.
    >>>>>
    >>>>>tb
    >>>>>
    >>>>>
    >>>>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    >>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>>>since you are opening a form, that is where the error must be
    >>>>>>
    >>>>>>A possible source for your error may be a calculated control
    >>>>>>that makes reference to a control than sometimes contains a
    >>>>>>null value (that explains the sporadic problems)
    >>>>>>
    >>>>>>in an equation, you can wrap a control reference with NZ to
    >>>>>>avoid this problem
    >>>>>>
    >>>>>>example:
    >>>>>>
    >>>>>>=(nz([Sales]) - nz([Cost]))
    >>>>>>
    >>>>>>If that isn't it, is there any code behind
    >>>>>>fmnu_Add_CO_By_Project? If so, can you post it?
    >>>>>>
    >>>>>>
    >>>>>>Warm Regards,
    >>>>>>Crystal
    >>>>>>Microsoft Access MVP 2006
    >>>>>>
    >>>>>>*
    >>>>>> Have an awesome day ;)
    >>>>>>
    >>>>>> remote programming and training
    >>>>>> strive4peace2006 at yahoo.com
    >>>>>>
    >>>>>>*
    >>>>>>
    >>>>>>tb wrote:
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>>The full code is as follows:
    >>>>>>>
    >>>>>>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>>>>>On Error GoTo Err_cmd_Add_CO_Amendment_Click
    >>>>>>>
    >>>>>>> Dim stDocName As String
    >>>>>>> Dim stLinkCriteria As String
    >>>>>>>
    >>>>>>> stDocName = "fmnu_Add_CO_By_Project"
    >>>>>>> DoCmd.OpenForm stDocName, , , stLinkCriteria
    >>>>>>>
    >>>>>>>Exit_cmd_Add_CO_Amendment_Click:
    >>>>>>> Exit Sub
    >>>>>>>
    >>>>>>>Err_cmd_Add_CO_Amendment_Click:
    >>>>>>> MsgBox Err.Description
    >>>>>>> Resume Exit_cmd_Add_CO_Amendment_Click
    >>>>>>>
    >>>>>>>End Sub
    >>>>>>>
    >>>>>>>tb
    >>>>>>>
    >>>>>>>"strive4peace" <"strive4peace2006 at yaho" wrote:
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>>>Please post the code in cmd_Add_CO_Amendment_Click
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>Warm Regards,
    >>>>>>>>Crystal
    >>>>>>>>Microsoft Access MVP 2006
    >>>>>>>>
    >>>>>>>>*
    >>>>>>>> Have an awesome day ;)
    >>>>>>>>
    >>>>>>>>remote programming and training
    >>>>>>>>strive4peace2006 at yahoo.com
    >>>>>>>>
    >>>>>>>>*
    >>>>>>>>
    >>>>>>>>tb wrote:
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>>I took over a database from someone ca. one year ago. Since then, I have had
    >>>>>>>>>various problems with it. My most recent and difficult is "Invalid Data
    >>>>>>>>>Format". Sometimes when can enter the database and click on a command button,
    >>>>>>>>>the message appears opening VB, highlighting a specific code, i.e.
    >>>>>>>>>
    >>>>>>>>>Private Sub cmd_Add_CO_Amendment_Click()
    >>>>>>>>>
    >>>>>>>>>The next time I enter the DB and click on the same command button, I receive
    >>>>>>>>>no error message. Sometimes I must enter 3-4x before I receive no error.
    >>>>>>>>>
    >>>>>>>>>I have had several people look at the code and no one has been able to
    >>>>>>>>>figure out what the problem is. So, any assistance would be greatly
    >>>>>>>>>appreciated.
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>
     

Share This Page