Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Option Buttons (2000)

    Hello, I have option buttons yes (value 1) and no (value 2). 2 is the default, if Yes is selected I need to have a text box (memo data type) displayed and ready for input, when no is selected the text box is greyed out. I have put this on the option event on update:

    Private Sub Proactive_AfterUpdate()
    If Me![Proactive] = 1 Then
    Me![Details].Enabled = True
    Else
    Me![Details].Enabled = False
    Me![Details].Enabled = Null

    End If
    End Sub

    However I this falls down and I can't understand why? Any ideas please?

    Thanks Darren.

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

    Re: Option Buttons (2000)

    The line Me![Details].Enabled = Null is incorrect, it should be Me![Details] = Null. Is that enough to solve the problem? If not, what is the error you get and where does it occur?

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (2000)

    Thank u Hans, that was so obvious, wood for trees springs to mind.

    Kind regards Darren.

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (2000)

    The solution worked on a mock up at home, now I have come back to work it doesn't work.

    Code is:

    Private Sub Proactive_AfterUpdate()
    If Me![Proactive] = 1 Then
    Me![Details].Enabled = True
    Else
    Me![Details].Enabled = False
    Me![Details] = Null

    End If
    End Sub

    error is at
    Me![Details].Enabled = False

    error is runtime 484, object doesn't support this property or method


    Thanks Darren.

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

    Re: Option Buttons (2000)

    Can you check the following, please?
    - Open the form in design view.
    - Select Details from the Object dropdown list in the Formatting (Form/Report) toolbar.
    - Activate the Data tab of the Properties window.
    - 1) What is the caption of the Properties window?
    - 2) Is the Enabled property listed?
    I have attached a screenshot to illustrate what I mean.
    Attached Images Attached Images
    • File Type: png x.PNG (7.5 KB, 0 views)

  6. #6
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (2000)

    What is your text box called?
    If it is called Details AND the underlying field is called Details then that would cause the error you are seeing.
    Just a thought <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Option Buttons (2000)

    Set Me!Details to Null before you try to disable it. Otherwise, you get an error.
    Charlotte

  8. #8
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (2000)

    Thanks guys, I have resolved the problem, I am a tad embarrassed at why it wasn't working, a glaring fundamental I missed, please forgive me for not sharing.

    Regards Darren.

Posting Permissions

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