Home All Groups Group Topic Archive Search About

Opening a form based on the result of a MsgBox

Author
28 May 2005 3:10 PM
PM
After users click on a button on a main form, they are presented with a
question.  If they answer 'Yes', the next form is to open with records
visible for them to choose from.  If they answer 'No', the same form is to
open with no records to choose from.  It should allow them to create a new
record in the database.

The command button of the main form has an If .. Then statement.  Right now,
only the If part of it has code.  The code is

If response = MsgBoxResult.Yes Then
            Dim frmUserInformation As New frmUserInformation
            frmUsertInformation.ShowDialog()

The Form_Load procedure of the user information form has the code to load
the User information from the database.

I want to be able to load the new form based on what the user clicks in the
dialog box.  The new form will either allow them to choose a record, or allow
them to create a new one.

Please help.  I am new to VB.  I appreciate it.

P

Author
28 May 2005 3:26 PM
Bob Butler
"PM" <P*@discussions.microsoft.com> wrote in message news:8F61688F-03C8-
4BB4-9C9C-D70BCE6BF***@microsoft.com
Show quoteHide quote
> After users click on a button on a main form, they are presented with
> a question.  If they answer 'Yes', the next form is to open with
> records visible for them to choose from.  If they answer 'No', the
> same form is to open with no records to choose from.  It should allow
> them to create a new record in the database.
>
> The command button of the main form has an If .. Then statement.
> Right now, only the If part of it has code.  The code is
>
> If response = MsgBoxResult.Yes Then
>             Dim frmUserInformation As New frmUserInformation
>             frmUsertInformation.ShowDialog()


--
<response type="generic" language="VB.Net">
This newsgroup is for users of Visual Basic version 6.0
and earlier and not the misleadingly named VB.Net
or VB 200x.  Solutions, and often even the questions,
for one platform will be meaningless in the other.
When VB.Net was released Microsoft created new newsgroups
devoted to the new platform so that neither group of
developers need wade through the clutter of unrelated
topics.  Look for newsgroups with the words "dotnet" or
"vsnet" in their name.  For the msnews.microsoft.com news
server try these:

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb

</response>