On error handling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3665

    #16
    Well, it appears that Lines 9-26 are trying to add a new client, even if there is an exisiting client.

    So, from a trouble shooter's perspective, we have to figure out why it it doing that. Let's add a few lines of code to help us out here (you can always delete this code later on).

    Add this code between lines 8 and 9:

    Code:
            Dim strFirstTest As String
            Dim strLastTest As String
            Dim dtDOBTest as Date
            strFirstTest = Me("First Name")
            strLastTest = Me("Last Name")
            dtDOBTest = Me.DOB
            MsgBox "Here are your values:" & vbCrLf & vbCrLf & _
                "First:  " & strFirstTest & vbCrLf & _
                "Last:  " & strLastTest & vbCrLf & _
                "DOB:  " & dtDOBTest, vbOkOnly
            Exit Sub
    Now, when you run the code, what the the pop up tell you the values are and, more importantly, how do they differ from the values input into the form?

    I am causing the code to exit before any records are added, because we just want to test the values the code comes up with.

    Yes, we are taking this truly at one step at a time.

    Comment

    • MysticElaine
      New Member
      • Jun 2014
      • 26

      #17
      Ok, I did that and the message box popped up with all the correct values with the exception that the DOB added a year. My table has it as a text value since we can only type MM/DD.

      Comment

      • MysticElaine
        New Member
        • Jun 2014
        • 26

        #18
        So I took out the # and replaced with ' in the code and it works!!!

        *happy dance*

        Comment

        • MysticElaine
          New Member
          • Jun 2014
          • 26

          #19
          Thank you so much!!!!! I appreciate your time and patience with me and for getting me through this problem!

          *Gives you lots of baked goodies*

          Comment

          • twinnyfo
            Recognized Expert Moderator Specialist
            • Nov 2011
            • 3665

            #20
            I am so glad that I could help. I know it seemed to take a long time, but at least now you can move forward!

            You know, I am especially fond of chocolate chip cookies! ;-)

            Comment

            Working...