Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select Case (AccessXP)

    I am trying to use the following code

    Dim intNumber As Variant
    intNumber = Forms![frmDateofBilling]![grpBillingNumber]
    txtBillingNumber = intNumber
    Select Case intNumber
    Case 1
    txtBillingNumber = ""
    Case 2
    txtBillingNumber = "Second Billing"
    Case 3
    txtBillingNumber = "Third Billing"
    End Select

    I have a form (frmDateofBilling) where the user marks the date the billing was compiled, member ID (if they only want a specific report), and if this is the 1st, 2nd, or 3rd billing for that invoice. When I click the appropriate button to activate the report I get a runtime error saying I can't assign a value to this object. The object is a unbound textbox. What am I not seeing?

    Thank you for your help. Fay

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Select Case (AccessXP)

    First of all, where are you using this code? And is this the code that is producing the error?

    Without knowing anything else, I'm going to say that your best bet would be to use the Choose function in the controlsource for txtBillingNumber, like this:
    =Choose(Forms![frmDateofBilling]![grpBillingNumber], "", "Second Billing", "Third Billing")
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select Case (AccessXP)

    Sorry about that. I try to be complete but fail that time. It was in the open event for the form.

    But your choose function worked like a champ. Another new function I have never seen.

    Thanks Fay

Posting Permissions

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