Radio Buttom SetFocus

H

Harrison

There are two radio buttons on this form. There is code to enable combo box
field when user selects one of the two radio buttons.

My question is this... I open the form and have code to enable the first
combo box [ToEmployee] but the radio button is not selected. How can I get
the radio button to show selected. I have tried setfocus on the event OnLoad
and OnActive. Not working.

My in the combo box is as follows.
Private Sub optToDepartment_GotFocus()
[Forms]![frmTransferred New]![ToEmployeeID].Enabled = False
[Forms]![frmTransferred New]![ToEmployeeID].Value = Null
[ToDepartmentID].Enabled = True
End Sub

Private Sub optToEmployee_GotFocus()
[Forms]![frmTransferred New]![ToEmployeeID].Enabled = True
[Forms]![frmTransferred New]![ToDepartmentID].Value = Null
[Forms]![frmTransferred New]![ToDepartmentID].Enabled = False
End Sub

The code for event OnLoad is...
Call optToEmployee_GotFocus

Controls Names:
Radio Button
optToEmployee (lblToEmployee)
optToDepartment (lblToDepartment)
Combo Box
ToEmployeeID
ToDepartmentID
 
G

Guest

hi,
me.optionbutton1 = true
if me.optionbutton1 = true then
me.optionsbutton2 = false
me.optionsbutton1.set focus
end if
 
H

Harrison

I put this code in OnLoad event

Me.optToEmployee = True
If Me.optToEmployee = True Then
Me.optToDepartment = False
Me.optToEmployee.SetFocus
End If

This give me a run-time error: -2147352567 (800020009)
You can't assign a value to this object.
pointing to "Me.optToEmployee = True"

Thanks,
Harrison

hi,
me.optionbutton1 = true
if me.optionbutton1 = true then
me.optionsbutton2 = false
me.optionsbutton1.set focus
end if
-----Original Message-----
There are two radio buttons on this form. There is code to enable combo box
field when user selects one of the two radio buttons.

My question is this... I open the form and have code to enable the first
combo box [ToEmployee] but the radio button is not selected. How can I get
the radio button to show selected. I have tried setfocus on the event OnLoad
and OnActive. Not working.

My in the combo box is as follows.
Private Sub optToDepartment_GotFocus()
[Forms]![frmTransferred New]![ToEmployeeID].Enabled = False
[Forms]![frmTransferred New]![ToEmployeeID].Value = Null
[ToDepartmentID].Enabled = True
End Sub

Private Sub optToEmployee_GotFocus()
[Forms]![frmTransferred New]![ToEmployeeID].Enabled = True
[Forms]![frmTransferred New]![ToDepartmentID].Value = Null
[Forms]![frmTransferred New]![ToDepartmentID].Enabled = False
End Sub

The code for event OnLoad is...
Call optToEmployee_GotFocus

Controls Names:
Radio Button
optToEmployee (lblToEmployee)
optToDepartment (lblToDepartment)
Combo Box
ToEmployeeID
ToDepartmentID
.
 

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