references to Public function not recognised

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Darry
    New Member
    • Oct 2008
    • 3

    references to Public function not recognised

    Hope someone can help or at least tell me what the hell is going on!

    Quite a complex MDB which has been working fine for several months and being developed.

    [U]problem no 1[/U] I have a public function in a module to return day name which has ceased to work on a single form, but stiil works on other forms.

    Have tried rebuilding new Copy DB with new forms copied over from backups that did work but it wont work.

    What did work was if i changed name of function (but then i would have to change all other refernces to it and doesnt solve the reason why)

    I thought it might be a corrupt form but..........

    Hope someone has the explanation
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    Go into the module that is calling the function and click in the margin next to sub that is callling it, where it says Private Sub somesub().

    If you have added an On Error Resume Next statement to the sub, comment it out.

    Close the module and invoke the action that isn't working properly.

    The VB window will open again and a little yellow arrow will appear over the dot marking the position in code.

    Now press F8 to step through the code piece by piece. If you hover your mouse over each variable in the code, it will display its value. Follow it through and see if it gives you any insights.

    Comment

    • Darry
      New Member
      • Oct 2008
      • 3

      #3
      Originally posted by GazMathias
      Go into the module that is calling the function and click in the margin next to sub that is callling it, where it says Private Sub somesub().

      If you have added an On Error Resume Next statement to the sub, comment it out.

      Close the module and invoke the action that isn't working properly.

      The VB window will open again and a little yellow arrow will appear over the dot marking the position in code.

      Now press F8 to step through the code piece by piece. If you hover your mouse over each variable in the code, it will display its value. Follow it through and see if it gives you any insights.

      Gaz, Thanks.

      I have doen all what you say etc but the form just appears dead. On other forms when you write the reference to public routine you get an auto prompt(?) signifying the reference/variable.

      The stranges thing is that when you do exactly the same on the "dead" form no prompt is shown - the form just appears dead.

      i dont know if there is some corruption. I have tried copying / rebuilding / reqwriting / exporting but......

      So inanswer to your post it identifies that the form VB isnt active but i dont know what to do next

      Comment

      Working...