Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Okay, first things first. What is the form and it associated code where the compile fails? Is it

    frmEditPropass and frmNewProperty?

    in the db that compiles, the is where I find the line:

    Forms!sfrmPropertyPass1.updateButtons

    So it must fail (in the db that fails) on those two forms' VBA code. Obviously, only one can fail first, but that is where the code (Forms!sfrmPropertyPass1.updateButtons) is on those two forms.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou_Reed

  2. #17
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Quote Originally Posted by pbaldy View Post
    There was a code difference in the recent db's. In the previous one you had:

    updateButtons

    to call the function from another form, in the latest it was:

    Forms!sfrmPropertyPass1.updateButtons

    The first threw the compile error, the second won't.
    Okay, on the db that fails where is the code line

    updateButtons

    on what form's code? In the db that does not fail where is the line:

    Forms!sfrmPropertyPass1.updateButtons

    I mention this because the failure of the code line

    updateButtons

    is associated with frm_Personnel.

    Also, in the form that fails both frmEditProperty and NewProperty.

    Have thew line:

    Forms!sfrmPropertyPass1.updateButtons

    near the bottom in the Sub btnSaveRecord_click. For the db that fails that is the only instances where they are. They are nowhere else.

    Now those two forms and their code are the same for both db (the one that works and the one that fails)..

    In the db that works where is additional instance of the line Forms!sfrmPropertyPass1.updateButtons? That is only in the db that works and not the db that fails it is missing.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed


  3. #18
    CodeLiftSleep is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    May 2017
    Posts
    48
    Quote Originally Posted by Lou_Reed View Post
    Okay, but again to what purpose does the phrase "Cancel as Integer" serve?

    When I added that to the code I got a new error, but an error nonetheless

    The modified db and the pdf file are attached. How to remove this error.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    It doesn't matter what purpose it serves, that is the signature needed to use that method properly.

  4. #19
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Quote Originally Posted by pbaldy View Post
    There was a code difference in the recent db's. In the previous one you had:

    updateButtons

    to call the function from another form, in the latest it was:



    Forms!sfrmPropertyPass1.updateButtons

    The first threw the compile error, the second won't.
    Forms!sfrmPropertyPass1.updateButtons

    Where is this line in the db whose VBA code complies and what is in its place in the db whose VBA code does not compile?

    I think it is as basic as I can make it. Sorry about the palaver above.

    Respectfully,

    Lou Reed

  5. #20
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, I think that I see the error. In the db whose VBA code compiles there is an abbreviated frmPersonnel. Several Subs and Functions are missing including the one that contains
    updateButtons.

    So obviously it compiles with no problem; upodateButtons is missing. In the db whose VBA code fails to compile the frmPersonnel is much larger with many more subs and functions; including the one that contains update buttons.

    The way to fix this is to put a definition sub or function for update buttons in the frmPersonnel.

    If there is another easier way, please tell me.

    Respectfully.

    Lou Reed

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I don't have the big picture of what you're trying to accomplish. If it will always refer to the same form/subform, you can change the "Me" references to the full reference "Forms!FormName.SubFormName.Form.ControlName" and put the function in a standard module. Then you can just call it with the function name from anywhere.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    This question may be off base, but I will ask it anyway. I have looked on the internet for a list of known problems that arise when one translates an MS macro to its corresponding VBA code. I have found many, most with the timely and accurate help from many experts on the MS Access Forums.

    However, I was wondering if there is any list or tech-report that lists all or most known inconsistencies. I have not found one on the internet, but I have not looked everywhere.

    It would help to if there were such a list.

    Is there and where might I locate it?

    Any help appreciated. Thanks in advance.


    Respectfully,


    Lou Reed

  8. #23
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    It would be helpful if someone could answer the question in Post # 22. There must some compiled list like that,
    that shows the obvious errors when an Access macro is converted to VBA code.

    Any help appreciated. Thanks in advance.


    Respectfully,


    Lou Reed

  9. #24
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I didn't answer because I'm not aware of such a list. I'd guess the lack of responses indicates nobody else is either.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #25
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, thanks for the effort. I just thought that there had to be one somewhere. It seems to be a systemic prpbelkm when you convert Access macros to VBA code.

    Thanks again.

    Respectfully,

    Lou Reed

  11. #26
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    To be honest, I don't know that it's used that much. It's a handy learning tool, but I doubt much production code gets written that way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error in VB code
    By Lou_Reed in forum Access
    Replies: 19
    Last Post: 09-21-2016, 08:50 AM
  2. Error in VB code
    By Lou_Reed in forum Access
    Replies: 1
    Last Post: 09-19-2016, 02:47 PM
  3. Replies: 1
    Last Post: 04-10-2015, 07:40 AM
  4. VBA Code Returning Error Run Time Error 3061
    By tgwacker in forum Access
    Replies: 2
    Last Post: 11-24-2013, 11:00 AM
  5. Form compilation failed?
    By pbuck in forum SharePoint
    Replies: 1
    Last Post: 11-26-2012, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums