• Select case nulls fields (2000)

    Author
    Topic
    #405430

    I have a receipt form and default bank account numbers, credit card numbers etc for individual payers. I want to blank out the credit card details if they pay by cheque or cash this time, the bank details if they pay by cash or credit card etc. I have the following on the after update of the combo which allows me to choose the payment method but it seems to do nothing. Where have I gone wrong

    Private Sub PaymentMethod_AfterUpdate()
    Select Case Me.[PaymentMethod]
    Case “Cash”
    Me![BankAccountName] = Null
    Me![BankName] = Null
    Me![BankBranch] = Null
    Me![BankBSB] = Null
    Me![CreditCardType] = Null
    Me![CreditCardName] = Null
    Me![CreditcardNo] = Null
    Me![ExpiryDate] = Null
    Case “Cheque”
    Me![CreditCardType] = Null
    Me![CreditCardName] = Null
    Me![CreditcardNo] = Null
    Me![ExpiryDate] = Null
    Case “Credit Card”
    Me![BankAccountName] = Null
    Me![BankName] = Null
    Me![BankBranch] = Null
    Me![BankBSB] = Null
    Case “Money Order”
    Me![BankAccountName] = Null
    Me![BankName] = Null
    Me![BankBranch] = Null
    Me![BankBSB] = Null
    Me![CreditCardType] = Null
    Me![CreditCardName] = Null
    Me![CreditcardNo] = Null
    Me![ExpiryDate] = Null
    Case “Direct Deposit”
    Me![CreditCardType] = Null
    Me![CreditCardName] = Null
    Me![CreditcardNo] = Null
    Me![ExpiryDate] = Null
    End Select

    End Sub

    TIA
    Steve

    Viewing 2 reply threads
    Author
    Replies
    • #832853

      What is the column count of the PaymentMethod combo box, and what are the column widths? If the bound column is hidden (column width=0), the actual value of the combo box may be a numeric code for the payment method. If so, you should use the code instead of the displayed text.

    • #832854

      What is the column count of the PaymentMethod combo box, and what are the column widths? If the bound column is hidden (column width=0), the actual value of the combo box may be a numeric code for the payment method. If so, you should use the code instead of the displayed text.

    • #832861

      Another way to check this is to put this line before the select case statement

      msgbox(me![Paymentmethod])

      This will display to you the actual value being tested.

      • #833226

        Exactly what it was – I had been a good boy and was graduating from storing words to (eg Riders Names) to the correcter !! way of RiderID etc and had forgotten I was storing the PaymentmethodID instead of the payment method word.

        Thank you both again – At this point you must wake up screaming when you see my inane questions and it must be hard working out who is going get the short straw and have to help the idiot this time
        It really is appreciated
        Steve

      • #833227

        Exactly what it was – I had been a good boy and was graduating from storing words to (eg Riders Names) to the correcter !! way of RiderID etc and had forgotten I was storing the PaymentmethodID instead of the payment method word.

        Thank you both again – At this point you must wake up screaming when you see my inane questions and it must be hard working out who is going get the short straw and have to help the idiot this time
        It really is appreciated
        Steve

    Viewing 2 reply threads
    Reply To: Reply #833226 in Select case nulls fields (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel