Re: Setfocus in on change event hangs
Hi everyone,
I was wondering if anyone could some insight on my problem.
I'm using AC2K and SQL Server 2K. I copied my FE onto the user's machine.
The user's machine has similiar storage space & RAM and configuration as
mine. There are two text boxes on the form w/ on change events When I try
test the code it hangs from 8 seconds to 30 seconds on both of these
controls.
I stepped thru the code it ran Exit Sub in the subroutines and hangs.
I also removed all the code except .setfocus in the change event and it still hangs.
Here is my code:
Private Sub msp_barcode_Change()
On Error GoTo Err_msp_barcode_Change
Dim bag_n As Integer
Dim get_prev_bag_info As New ADODB.Command
Call load_const
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)
Call get_bag(Left(Me!work_ord_num.Value, 6), Me!work_ord_line_num.Value, get_prev_bag_info)
Set get_prev_bag_info = Nothing
If Me!bag_num.Value <> "1" Then
Me!unb_bag_quantity.SetFocus
Else
Me!material_lotnum.Value = ""
Me!insert_lotnum.Value = ""
Me!mfg_dt.Value = ""
Me!material_lotnum.SetFocus
End If
End If
Exit_msp_barcode_Change:
Exit Sub
Err_msp_barcode_Change:
MsgBox err.Description
Resume Exit_msp_barcode_Change
Hi everyone,
I was wondering if anyone could some insight on my problem.
I'm using AC2K and SQL Server 2K. I copied my FE onto the user's machine.
The user's machine has similiar storage space & RAM and configuration as
mine. There are two text boxes on the form w/ on change events When I try
test the code it hangs from 8 seconds to 30 seconds on both of these
controls.
I stepped thru the code it ran Exit Sub in the subroutines and hangs.
I also removed all the code except .setfocus in the change event and it still hangs.
Here is my code:
Private Sub msp_barcode_Change()
On Error GoTo Err_msp_barcode_Change
Dim bag_n As Integer
Dim get_prev_bag_info As New ADODB.Command
Call load_const
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)
Call get_bag(Left(Me!work_ord_num.Value, 6), Me!work_ord_line_num.Value, get_prev_bag_info)
Set get_prev_bag_info = Nothing
If Me!bag_num.Value <> "1" Then
Me!unb_bag_quantity.SetFocus
Else
Me!material_lotnum.Value = ""
Me!insert_lotnum.Value = ""
Me!mfg_dt.Value = ""
Me!material_lotnum.SetFocus
End If
End If
Exit_msp_barcode_Change:
Exit Sub
Err_msp_barcode_Change:
MsgBox err.Description
Resume Exit_msp_barcode_Change