+ Reply to Thread
Results 1 to 7 of 7

Msgbox not displaying when called

  1. #1
    Registered User
    Join Date
    04-19-2012
    Location
    Leeds, England
    MS-Off Ver
    Office for Mac 2011
    Posts
    17

    Msgbox not displaying when called

    Hi all,

    I have a message box that when yes is clicked, it runs code.

    However in the code that runs, i have another msgbox that says that the action was completed. When i run the called code manually it works fine however when i allow it to be called it does not work. I will post the code below.

    Please Login or Register  to view this content.
    This is what is called.

    Please Login or Register  to view this content.

    Can you call a msgbox from a msgbox?

    Any help on this would be amazing.

    Thanks

    Adam

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Msgbox not displaying when called

    Hello Adam,

    Your code is trying to assign the value vbYes to the MsgBox. It needs to be reversed. Store the result and then test it.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Msgbox not displaying when called

    Hi

    Where are the 2 bits of code? Is the commandbutton on a form, or on a sheet? Is Save_Event in a general module?

    rylo

  4. #4
    Registered User
    Join Date
    04-19-2012
    Location
    Leeds, England
    MS-Off Ver
    Office for Mac 2011
    Posts
    17

    Re: Msgbox not displaying when called

    The command button is on a form and the save_event is on module 4

  5. #5
    Registered User
    Join Date
    04-19-2012
    Location
    Leeds, England
    MS-Off Ver
    Office for Mac 2011
    Posts
    17

    Re: Msgbox not displaying when called

    ok i have changed the code and added a line but now the new line is not working and the msgbox is not calling.

    The button on the userform runs the following code
    Please Login or Register  to view this content.
    This is the called macro that is in a module
    Please Login or Register  to view this content.
    The above line of code is not working and the message box will not run. It will run if i run it directly but if i use the call function from the button. I hope you understand what i am saying as i have not communicated this very well.

    Thanks

    Adam

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Msgbox not displaying when called

    Adam

    Can you create and attach an example file that has all the relevant parts (sheets, forms, code, some test data).

    rylo

  7. #7
    Registered User
    Join Date
    04-19-2012
    Location
    Leeds, England
    MS-Off Ver
    Office for Mac 2011
    Posts
    17

    Re: Msgbox not displaying when called

    Guys i am so sorry for wasting your time. I have been looking through all of my code and it appears that not only do i have a macro called save_event but i also have code on the form called save_event so i have been confusing the software on what to call and it obviously calls the code on the form first. I have changed the code on the form and it is now working.

    Thanks and my apologies.

    Adam

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1