Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, BC
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selective Text Box Disabling (Access 2000)

    Hi,

    I've created a simple data entry form for orders, with such text box entries as name, address, city, phone number, subscriber number, etc. I've also set up a pair of option buttons to click based on whether the caller has a subscriber number or not. If the caller is not a subscriber, you would have to fill in all the text boxes. If the caller is a subscriber, you'd need only to fill in the phone number and the subscriber number.

    Is there a simple way to set up the form so that if the user clicks the "subscriber" radio button that the text boxes for name, address, city, etc. would be grayed out, and only the necessary text boxes would be accessible for data entry?

    Hope this isn't too dumb a question.

    Thanks for any help!

    John DeA

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selective Text Box Disabling (Access 2000)

    In the Lost Focus Event for subscriber of phone number box, validate the data. If a match is found then lock all the other fields or disable them. (Use dlookup.) If not valid then tell them the data is invalid and they need to fill in the data. If the form is to remain open you may want to populate the fields with the subscriber data.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

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

    Re: Selective Text Box Disabling (Access 2000)

    I'd just create a little procedure that included lines like this (I'm guessing at control names):
    txtAddress.enabled = not (chkSubscriber)
    txtCity.enabled = not (chkSubscriber)
    etc.

    Call this procedure from your Subscriber checkbox AfterUpdate event, also from the form's current event.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, BC
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selective Text Box Disabling (Access 2000)

    Hi again,

    Sorry, I didn't explain the problem properly. This form belongs to a stand alone database. If the caller is a customer, we'll be matching them up later with another database or spreadsheet; it's impossible to do on the spot data validation and then populate the rest of the fields. All I want to do is, in the case of a subscriber calling in, is to gray out the unnecessary fields so that the people taking the call will have as little to type in as possible.

    It would be wonderful if we had access to our subscriber data for this, but I've been told that won't happen.

    Thanks again,

    John

  5. #5
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, BC
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selective Text Box Disabling (Access 2000)

    Thanks! I will give this a try...

    John

Posting Permissions

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