error handeling


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: error handeling

  1. #1
    Roy Guest

    Re: error handeling

    Use OptionButton instead.

    Roy

    "jitterbug" <cholewa@uwm.edu> wrote in message news:3cc5a738$1@10.1.10.29...
    >
    > my problem is that i give the user 2 choices (sq ft or acres) and I want to
    > make sure that only one choice is used (if users checks more than one, a
    > MsgBox "please only chose one") I do not know how to state this.
    > here is what I have already, and i would like to know where to put the error
    > handle so that only Acre or SqureFeet is used. these are text boxes that
    > the user enters a value so i figure that if both txtboxes have a value then
    > error, but i do not know to state this exactly.
    > Thank you...
    >
    > ' Setting choice of measurement
    > AcreValue = frmUse.txtAcre.Text
    > SqureFeetVaule = frmUse.txtFeet.Text
    >
    > 'Create the query filter
    > Set pQueryFilter = New QueryFilter
    > If (frmUse.chkInd.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'Indutry' and ACRES >= AcreValue "
    > ElseIf (frmUse.chkRes.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'Residential' and ACRES >= AcreValue"
    > ElseIf (frmUse.chkMRes.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'multi-residential' and ACRES >=
    > AcreValue"
    > ElseIf (frmUse.chkCom.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'commercial' and ACRES >= AcreValue"
    > ElseIf (frmUse.chkIns.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'institutional' and ACRES >=
    > AcreValue"
    > ElseIf (frmUse.chkPublic.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'public' and ACRES >= AcreValue"
    > Else
    > MsgBox ("I can't read minds, make a chioce!!")
    > End
    > End
    > End
    > End
    > End
    > End
    > End If
    >




  2. #2
    jitterbug Guest

    error handeling


    my problem is that i give the user 2 choices (sq ft or acres) and I want to
    make sure that only one choice is used (if users checks more than one, a
    MsgBox "please only chose one") I do not know how to state this.
    here is what I have already, and i would like to know where to put the error
    handle so that only Acre or SqureFeet is used. these are text boxes that
    the user enters a value so i figure that if both txtboxes have a value then
    error, but i do not know to state this exactly.
    Thank you...

    ' Setting choice of measurement
    AcreValue = frmUse.txtAcre.Text
    SqureFeetVaule = frmUse.txtFeet.Text

    'Create the query filter
    Set pQueryFilter = New QueryFilter
    If (frmUse.chkInd.Value = True) Then
    pQueryFilter.WhereClause = "NAME = 'Indutry' and ACRES >= AcreValue "
    ElseIf (frmUse.chkRes.Value = True) Then
    pQueryFilter.WhereClause = "NAME = 'Residential' and ACRES >= AcreValue"
    ElseIf (frmUse.chkMRes.Value = True) Then
    pQueryFilter.WhereClause = "NAME = 'multi-residential' and ACRES >=
    AcreValue"
    ElseIf (frmUse.chkCom.Value = True) Then
    pQueryFilter.WhereClause = "NAME = 'commercial' and ACRES >= AcreValue"
    ElseIf (frmUse.chkIns.Value = True) Then
    pQueryFilter.WhereClause = "NAME = 'institutional' and ACRES >=
    AcreValue"
    ElseIf (frmUse.chkPublic.Value = True) Then
    pQueryFilter.WhereClause = "NAME = 'public' and ACRES >= AcreValue"
    Else
    MsgBox ("I can't read minds, make a chioce!!")
    End
    End
    End
    End
    End
    End
    End If


  3. #3
    Kevin Guest

    Re: error handeling


    I would agree with Roy. Use an option button and let it handle the exclusivity
    (is that a word?) for you. You can also default one of the buttons to handle
    the case of neither being selected. Then just have one textbox and assume
    the value in it is in the context of the selected option button.

    "jitterbug" <cholewa@uwm.edu> wrote:
    >
    >my problem is that i give the user 2 choices (sq ft or acres) and I want

    to
    >make sure that only one choice is used (if users checks more than one, a
    >MsgBox "please only chose one") I do not know how to state this.
    > here is what I have already, and i would like to know where to put the

    error
    >handle so that only Acre or SqureFeet is used. these are text boxes that
    >the user enters a value so i figure that if both txtboxes have a value then
    >error, but i do not know to state this exactly.
    >Thank you...
    >
    >' Setting choice of measurement
    > AcreValue = frmUse.txtAcre.Text
    > SqureFeetVaule = frmUse.txtFeet.Text
    >
    > 'Create the query filter
    > Set pQueryFilter = New QueryFilter
    > If (frmUse.chkInd.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'Indutry' and ACRES >= AcreValue

    "
    > ElseIf (frmUse.chkRes.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'Residential' and ACRES >= AcreValue"
    > ElseIf (frmUse.chkMRes.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'multi-residential' and ACRES >=
    >AcreValue"
    > ElseIf (frmUse.chkCom.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'commercial' and ACRES >= AcreValue"
    > ElseIf (frmUse.chkIns.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'institutional' and ACRES >=
    >AcreValue"
    > ElseIf (frmUse.chkPublic.Value = True) Then
    > pQueryFilter.WhereClause = "NAME = 'public' and ACRES >= AcreValue"
    > Else
    > MsgBox ("I can't read minds, make a chioce!!")
    > End
    > End
    > End
    > End
    > End
    > End
    > End If
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center