Hi all. This is a bit of an aesthetic problem.
I have a form containing two subforms and two comboboxes. When the forms first load, the first combobox receives focus. I'd like the text input cursor to be placed at the end of the text whenever the bombobox receives focus. Trolling Bytes.com tells me that the following code works for most people, so I put it in the cboEmpID_AfterU pdate event procedure.
It doesn't work for me, for whatever reason. The combobox receives focus and selects all its text, as usual. I also unsuccessfully tried adding the following, but to no effect:
Perhaps this has to do with some SetFocus shenanigans that runs right before, but I'm not sure. This is in place so that the datasheets in the subforms don't have their first cells selected. Here's the code:
Once again, this is aesthetic; the form runs perfectly otherwise.
I have a form containing two subforms and two comboboxes. When the forms first load, the first combobox receives focus. I'd like the text input cursor to be placed at the end of the text whenever the bombobox receives focus. Trolling Bytes.com tells me that the following code works for most people, so I put it in the cboEmpID_AfterU pdate event procedure.
Me.cboEmpID.Sel Start = Len(Nz(Me.cboEm pID, ""))
It doesn't work for me, for whatever reason. The combobox receives focus and selects all its text, as usual. I also unsuccessfully tried adding the following, but to no effect:
Me.cboEmpID.Sel Length = 0
Perhaps this has to do with some SetFocus shenanigans that runs right before, but I'm not sure. This is in place so that the datasheets in the subforms don't have their first cells selected. Here's the code:
subfrm_Emp.SetF ocus
cboEmpID.SetFoc us
cboEmpID.SetFoc us
Once again, this is aesthetic; the form runs perfectly otherwise.
Comment