Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is this possible. (2000)

    I have a form in which a user selects payment type (cash, credit, debit, check, etc.) I'd like to display upon click a certain form field specific to each selection. For example, if they choose cash, they wouldn't see anything else. But if they chose credit or debit, they would see a dropdown with the card choices, and if they chose check for example, they would see a check number box. Is this possible? Thanks beforehand!!

  2. #2
    New Lounger
    Join Date
    Dec 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Is this possible. (2000)

    Here's an idea from some code by John Viescas (I added the
    txtCheckNumber stuff):

    You could put a couple of textboxes on a form near your payment
    method combo box and set their visible property to False. You could
    have a textbox for credit card number and one for check number placed
    on top of each other but hidden. Then use a Select Case based on the
    value in your combo box to "unhide" the textbox you need based on your
    combo boxes value. Your combo boxes value list could be 1;"Cash";2;"Check";3;
    "American Express";4;"Visa";5;"Master Card";6;"Discover"


    Private Sub cboPayBy_AfterUpdate()
    ' Reveal txtCCNumber or txtCheckNumkber based on payment method
    Select Case Me!cboPayBy
    Case 1 'Cash
    Me!txtCCNumber = Null
    Me!txtCheckNumber = Null
    Me!CCNumber.Visible = False
    Me!xtCheckNumber.Visible = False
    Case 2 'Check
    Me!txtCCNumber = Null
    Me!CCNumber.Visible = False
    Me!xtCheckNumber.Visible = True
    Case 3 'American Express
    Me!txtCheckNumber = Null
    Me!xtCheckNumber.Visible = False
    Me!CCNumber.Visible = True
    Me!CCNumber.InputMask = "0000-000000-00000;0;_"
    Case Else 'Other Credit Cards
    Me!txtCheckNumber = Null
    Me!xtCheckNumber.Visible = False
    Me!CCNumber.Visible = True
    Me!CCNumber.InputMask = "0000-0000-0000-0000;0;_"
    End Select
    End Sub

    That sort of thing

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Is this possible. (2000)

    Your information fit my own case almost perfectly, and I'm trying to use it in a DB I'm building for a college fund-raiser. I've almost got this thing working, but I've hit one snag. When I select a payment method (let's say Visa), the window for the credit card number appears, but not the label ("Credit card number"). What must I change to make the "Credit card number" or "Check number" appear?

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

    Re: Is this possible. (2000)

    The label itself should have its visible property set to Yes. Labels attached to text boxes become visible/invisible with their "owner".

    If that doesn't help, perhaps the label has become detached from the text box. Try the following:

    Select the label.
    Cut it to the clipboard (Ctrl+X).
    Select the text box.
    Paste the label (Ctrl+V).
    If necessary, move the label to the desired position.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Is this possible. (2000)

    I see.... Thanks, Hans!

Posting Permissions

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