Results 1 to 3 of 3

Thread: Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2007
    Posts
    148

    Question

    Hi guys. just a quick question. In my vbscript code i had part of the code below and did not have to Dim it , now under vb 2005 express i have to Dim CreateExchangeAccount

    Why is this just out of interest?


    If CreateExchangeAccount.Value = 0 Then

    MsgBox("Please select Yes OR No to create Exchange Mailbox from the drop-down menu!")
    Exit Sub
    Else



    many thanks

  2. #2
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: Question

    Give this a try.

    VB Code:
    1. Dim CreateExchangeAccount As DialogResult
    2.  
    3.         CreateExchangeAccount = MessageBox.Show("Do you want to create an Exchange Mailbox?", "Exchange Mailbox?", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    4.  
    5.         If CreateExchangeAccount = Windows.Forms.DialogResult.Yes Then
    6.             ' Create the mailbox
    7.         End If
    My.Settings.Signature = String.Empty

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Question

    Option Explicit is turned on by default, which means you must explicitly decalre all variables. You should also turn Option Strict On, which means you must maintain strict typing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width