Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003

    Unanswered: Not reading code on form load

    The code is not being read on a form load event at runtime yet will when I step into the code.

    I am importing contact details into a table. This data is checked to make sure it meets certain criteria. For example it checks to see that an organisation exist that relates to the contact being imported. If no organisation exists it open a form displaying those no existent organisation and stop their so the contacts cannot be imported until the organisation exist.

    This is done by code on a form load event


    If txtCount = 0 Then
    DoCmd.OpenForm ("frmContactsUpdates"), acNormal
    DoCmd.Close acForm, "frmContactsNoInvestor"
    End If

    This works if I create a breakpoint and step through the code. If I remove the break point it does not seem to stop where it should.

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    To be honest I'm a little fuzzy as to exactly what you're doing here, but how is txtCount populated? Are you sure that txtCount is ever equal to Zero? If the control is simply empty it would be Null, rather than Zero, and wouldn't cause your code to execute.

    Unless you're sure that the control is being populated with a Zero, if the organization doesn't exist, a better check might be

    If Nz(Me.txtCount, "") = "" Then

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts