Radio button enables Combo Box

B

Beeyen

Hello Users

I have a radio button, which when the option selected is Yes, it enters the
current date and time. I have been trying to write code that would also have
the yes selection enable two combo boxes (combo box ControlNames are
ProductionAssigned and QandALead) or remained disabled. It is not working.
Could someone explain what I am doing wrong?

Private Sub Exceptionsyesbutton_AfterUpdate()
If Me.Exceptionsyesbutton = True Then
Me.[Exceptions_Resolved] = Now()
Me.[ProductionAssigned].Enabled = True
Me.[QandALead].Enabled = True


Else
Me.[Exceptions_Resolved] = Null
Me.[ProductionAssigned].Enabled = False
Me.[QandALead.Enabled].Enabled = False

End If

End Sub
 
B

Beeyen

Good Day Mr B.

That did not work!

Thanks

Mr. B said:
Beeyen,

Try this:

Private Sub Exceptionsyesbutton_AfterUpdate()
If Me.Exceptionsyesbutton = True Then
Me.[Exceptions_Resolved] = Now()
Me.ProductionAssigned.Enabled = True
Me.QandALead.Enabled = True


Else
Me.[Exceptions_Resolved] = Null
Me.ProductionAssigned.Enabled = False
Me.QandALead.Enabled.Enabled = False

End If

End Sub

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


Beeyen said:
Hello Users

I have a radio button, which when the option selected is Yes, it enters the
current date and time. I have been trying to write code that would also have
the yes selection enable two combo boxes (combo box ControlNames are
ProductionAssigned and QandALead) or remained disabled. It is not working.
Could someone explain what I am doing wrong?

Private Sub Exceptionsyesbutton_AfterUpdate()
If Me.Exceptionsyesbutton = True Then
Me.[Exceptions_Resolved] = Now()
Me.[ProductionAssigned].Enabled = True
Me.[QandALead].Enabled = True


Else
Me.[Exceptions_Resolved] = Null
Me.[ProductionAssigned].Enabled = False
Me.[QandALead.Enabled].Enabled = False

End If

End Sub
 
M

Mr. B

Well, sorry about that. You didn't indicate what did happen. Did you get any
error messages?

If "Exceptions_Resolved" is the name of your date field then try the code
below. If that is not the name of the control then change the
"Exceptions_Resolved" to the actual name of your date contorl.

The issue here seemed to me to be that you had [] (square brackets) around
the control names. When you are refering to controls, as you are in this
situation, you do not need the square brackets. You only need to refer to
the control by name.

Private Sub Exceptionsyesbutton_AfterUpdate()
If Me.Exceptionsyesbutton = True Then
Me.Exceptions_Resolved = Now()
Me.ProductionAssigned.Enabled = True
Me.QandALead.Enabled = True
Else
Me.Exceptions_Resolved = Null
Me.ProductionAssigned.Enabled = False
Me.QandALead.Enabled.Enabled = False
End If
End Sub

The statement below (changing the "NameOfYourContorl" to the actual name of
your control) will enable the control named in the statment:
Me.NameOfYourControl.Enabled = True

The statement below will disable the control named in the statement:
Me.NameOfYourControl.Enabled = False

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


Beeyen said:
Good Day Mr B.

That did not work!

Thanks

Mr. B said:
Beeyen,

Try this:

Private Sub Exceptionsyesbutton_AfterUpdate()
If Me.Exceptionsyesbutton = True Then
Me.[Exceptions_Resolved] = Now()
Me.ProductionAssigned.Enabled = True
Me.QandALead.Enabled = True


Else
Me.[Exceptions_Resolved] = Null
Me.ProductionAssigned.Enabled = False
Me.QandALead.Enabled.Enabled = False

End If

End Sub

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


Beeyen said:
Hello Users

I have a radio button, which when the option selected is Yes, it enters the
current date and time. I have been trying to write code that would also have
the yes selection enable two combo boxes (combo box ControlNames are
ProductionAssigned and QandALead) or remained disabled. It is not working.
Could someone explain what I am doing wrong?

Private Sub Exceptionsyesbutton_AfterUpdate()
If Me.Exceptionsyesbutton = True Then
Me.[Exceptions_Resolved] = Now()
Me.[ProductionAssigned].Enabled = True
Me.[QandALead].Enabled = True


Else
Me.[Exceptions_Resolved] = Null
Me.[ProductionAssigned].Enabled = False
Me.[QandALead.Enabled].Enabled = False

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top