Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    21

    Unanswered: Changing an If Statement

    Hello All,

    So I have this:

    if ExpAmt = "" then
    bExpAmt_missing = true
    bValid = false
    elseif not IsNumeric(ExpAmt) then
    bExpAmt_valid = false
    bValid = false
    end if

    if bValid then
    oConn.Execute = "INSERT INTO tbl_expenses (Expense_Type, Expense_Note, Truck_id, Input_employee, Branch_id, qty, unitprice, ExpAmt, Expense_Date) " &_
    "VALUES (" & Expense_Type & ", '" & Expense_Note & "', " & Truck_id &_
    ", " & Employee_ID & ", " & branchid & ", " & qty & ", " & Unitprice & ", " & ExpAmt & ", DATE())"

    end if
    end if

    <td class="td_results" style="border-right: 0" colspan="5">
    <%if Request.Form <> "" and not bValid then%>
    <p class="red_text">Please enter a valid expense amount.</p>
    <%else%>
    <p>&nbsp;</p>
    <%end if%>



    I want to add to more controls on the form which require a numeric input, so I get the same message and results, currently the expamt works fine but need to include qty and unitprice, I was wondering if a select case statement might work?

    Thanks in Advance

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Use a function.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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