Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7778323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:22:08+00:00 2026-06-01T18:22:08+00:00

Just as an example, say I’d like to reference a msgbox in multiple areas,

  • 0

Just as an example, say I’d like to reference a msgbox in multiple areas, could I create a function for this? Private or Public? Differences?

Here’s an example.

Public Function Message() As String
   MsgBox("Test Message")
End Function

Also, why would I get the following message: Function 'Message' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used

It seems as though its just a warning and it seemed to work when I called the function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:22:10+00:00Added an answer on June 1, 2026 at 6:22 pm

    Make it Sub so it’s not expecting a return value.

    Public Sub Message() As String
       MsgBox("Test Message")
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Best explained with code I think, this is just a simple example: public class
Lets say I have the following jQuery plugin (this is just an example to
This is just an example, but given the following model: class Foo(models.model): bar =
Input: $string = this-is-just-an--example Output: this is just an-example Tried various things centered around
Usually I was doing something like that (just a example): using (Stream xmlStream =
I would like to change: http://example.com/index.php?p=blog&pid=2&lid=1&l=en into just http:// example.com/en/blog.html or just http:// example.com/blog.html
Is there something like Python with context manager in Java? For example say I
I'm just wondering if Specification pattern is pointless, given following example: Say you want
I have a solution with multiple projects in it, so for example say 10
I have defined a custom object with multiple fields. For example say I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.