Guys,
I'm facing a wierd problem and don't exactly know where the glitch is.
I have a form with Tab control in Access 2003. In each tab, I have a text box and two Datepicker controls. The wierd part is that sometimes (not all the times), as soon as I press the Tab key in the textbox, the Datepicker controls "Fly" to the topmost left corner of the form. I have checked every bit n piece of the code that I have written, but nowhere am I changing the position of the controls.
The following is the code written for the Text Box:
I'm also attaching the screenshots of the form for reference.
Hoping someone would have a clue and come up with a solution please......
Thanks.......
I'm facing a wierd problem and don't exactly know where the glitch is.
I have a form with Tab control in Access 2003. In each tab, I have a text box and two Datepicker controls. The wierd part is that sometimes (not all the times), as soon as I press the Tab key in the textbox, the Datepicker controls "Fly" to the topmost left corner of the form. I have checked every bit n piece of the code that I have written, but nowhere am I changing the position of the controls.
The following is the code written for the Text Box:
Code:
Private Sub txtEmpIDATT_Exit(Cancel As Integer)
If txtEmpIDATT.Text = "" Then
'do nothing
Else
Call cmdHidden1_Click
End If
End Sub
Private Sub cmdHidden1_Click()
On Error GoTo errr
Call conDB
EID = Trim(txtEmpIDATT.Text)
vSQL = "select emp_name,function from emp_master where emp_id=" & EID
Set rsMain = conMain.Execute(vSQL)
If rsMain.BOF = True Then
MsgBox "Either the Employee ID is incorrect or the employee doesn't exist in records.", vbCritical, "Employee ID"
Call att_reset
Else
txtEmpNameAtt.Caption = rsMain(0) & "/" & rsMain(1)
DTLWD.Enabled = True
DTDOA.Enabled = True
If rsMain(1) = "Attrition" Then
MsgBox "This employee has already attrited.", vbCritical, "Attrition"
Call att_reset
Else
'do nothing
End If
End If
Exit Sub
errr:
MsgBox Err.Description
Set rsMain = Nothing
Set conMain = Nothing
End Sub
Private Sub att_reset()
txtEmpIDATT.SetFocus
txtEmpIDATT.Text = ""
txtEmpNameAtt.Caption = ""
DTLWD.Enabled = False
DTDOA.Enabled = False
End Sub
Hoping someone would have a clue and come up with a solution please......
Thanks.......
Comment