MS access allowing user to stop form from poping up

How big a job would it be to create a copy of frmApplication to another, say called frmApplicationwithoutmsgbox and leave out the call to the msgbox on that form? Then, putting a field, "checkboxselected" in your database, you can check it when your form loads and instantiate an instance without the msgbox:

Code:
      Private Sub FormApplications_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
           OleDbDataAdapter.Fill(DataSet, "sometable")
           If  CBool(DataSet.Tables("sometable").Rows(0).Item("checkboxselected")) Then
            Dim frmApplicationswiththemsgbox as New fclsApplicationswiththemsgbox
            me.hide
             frmApplicationswiththemsgbox.Show()

            End If

Its one way.
 
Okay wait,
I just reread your question....its actually easier than that. Put
your call to the msgbox in an If/then statement doing the same query of the database and if the checkboxselected tests true,
dont show the msgbox.

Code:
Private Sub FormApplications_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

           OleDbDataAdapter.Fill(DataSet, "sometable")

 Your trigger here to call the msgbox

           If  Not CBool(DataSet.Tables("sometable").Rows(0).Item("checkboxselected")) Then

            messgebox.show("Warning Will Robinson, Danger Will Robinson") 

           
            End If
 
Back
Top