Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select case nulls fields (2000)

    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
    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select case nulls fields (2000)

    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.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Select case nulls fields (2000)

    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.
    Regards
    John



  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Now-Luanda, Angola, Originally - Anna Bay, New South Wales, Australia
    Posts
    238
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select case nulls fields (2000)

    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
    Dummy from Down Under <img src=/S/flags/Australia.gif border=0 alt=Australia width=30 height=18>

Posting Permissions

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