Re: Selstart property?

alicejwz

Registered User.
Local time
Today, 20:03
Joined
Jul 9, 2003
Messages
91
Re: Selstart property?

Hi all,

I don't have problem moving to the beginning of the text box with the code I have. But once the line ran the cursor is @ the beginning of the control but you can't write to it(nothing happens when typing into the field). if I remove the .selstart line out it will highlight the control but allows me to edit the field.

The material_lotnum control is bound to a field in a table.
The Acces property settings are
enabled yes
locked no

code:
Private Sub msp_barcode_Change()
If Len(Trim(Me!msp_barcode.Text)) = CInt(work_ord_num_length) + CInt(work_ord_line_num_length) Then

Me!work_ord_num.Value = Left(Me!msp_barcode.Text, 9)
Me!work_ord_line_num.Value = Right(Me!msp_barcode.Text, 3)
'get the next bag_num
Call get_bag(Left(Me!work_ord_num.Value, 6), Me!work_ord_line_num.Value, bag_n, get_prev_bag_info, rs_get_prev_bag_info)
If Me!bag_num.Value <> "1" Then
'the current Msp is found and the fields are populate w/ values
Me!bag_quantity.SetFocus
Else
'the current Msp is not found but the fields are populate w/ values from previous msp
'clear the fields
If Not IsNull(Me!material_lotnum.Value) Then
Me!material_lotnum.Value = ""
Me!insert_lotnum.Value = ""
Me!mfg_dt.Value = ""

End If
Me!material_lotnum.SetFocus
'moves to the beginning of the control but can't write to it
Me!material_lotnum.SelStart = Len(Me!material_lotnum.SelStart) - 1
End If
End If


Exit_msp_barcode_Change:
If rs_get_prev_bag_info.State = adStateOpen Then
rs_get_prev_bag_info.close
End If

Set get_prev_bag_info = Nothing
Exit Sub

Err_msp_barcode_Change:
MsgBox err.Description
Resume Exit_msp_barcode_Change
End Sub

Does anyone have a suggestion or see where the problem is at?
Appreciate your input.
 

Users who are viewing this thread

Back
Top Bottom