variable uses an automation type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CD Tom
    Contributor
    • Feb 2009
    • 495

    #1

    variable uses an automation type

    I've just started getting this message and can't figure out why and how to fix it. The program as been working fine and now that error keeps popping up.
    Code:
                VAssSASS = DLookup("[Assoc_SASS]", "[Associate]", "[sass_number] = " & cmbSASS & "")
                StrSql = "update masterb set DuesDue = #" & VNewDue & "#, DateduesPaid = #" & VCurdate & "#, paiddues = true where sass_number = " & VAssSASS & ""
    I get the error on the StrSql statement, When I look at the Variables the VAssSASS shows the error, I have an if statement when the error 458 occurs and branch back to the StrSql statement it works fine.
    Again this just started happening. I have the same statement in other programs and they seem to be working just fine.
    Don't know what to do, any help is greatly appreciated.
    Thanks
  • PhilOfWalton
    Recognized Expert Top Contributor
    • Mar 2016
    • 1430

    #2
    Line 1:
    Is CmbSASS giving a number or string? Either way there is an error with the inverted commas.

    Line 2:
    Is VAsssSASS a number or string? Either way there is an error with the inverted commas.

    Phil

    Comment

    • CD Tom
      Contributor
      • Feb 2009
      • 495

      #3
      After much testing and lots of errors I did come up with an answer. The check box that when checked ran the code was named DuesPaid, When the code ran I would get that error also if I quite the program right after that code ran Access would not end I would get a Blue screen and would have to go into Task manager to end Access. I changed the Name of the check box to CmdDues and just copied the code from the original procedure into the new one CmdDues and everything works. I don't have any idea why.

      Comment

      • CD Tom
        Contributor
        • Feb 2009
        • 495

        #4
        Well what I thought worked didn't. I'm back to the drawing board. When I run the procedure behind the check box and then exit the program I get that blue screen of Access which I have to use task manager to end.

        Comment

        • CD Tom
          Contributor
          • Feb 2009
          • 495

          #5
          when I compile the program and run the procedure that gives me the blue screen I get a message Execution of this application has stopped due to a run-time error. The application can't continue and will be shut down. If I click on the OK, it continues to give me the same blue screen with the same message. I have to use task manager to quite Access

          Comment

          • jforbes
            Recognized Expert Top Contributor
            • Aug 2014
            • 1107

            #6
            I don't think there is anything in the Code that would cause the errors you are getting, especiall if [Assoc_SASS] is a Number.

            I have a feeling that you are running into some corruption. I would Backup your Database as soon as possible. Then first I would try doing a decompile and see if things straighten up. If that doesn't work, I would create a new Database and import all the objects and code from the current one into it and see if that fixes the problem.

            There's a lot of different way to decompile, but my current favorite is to enter msaccess /decompile in to the Windows Run Box, which should open Access and have it set to decompile the first database that it encounters. Then open the database that you want decompiled, compile it, save it and then see if it works.

            Comment

            Working...