here is my inputbox (of A form's load event):
.RowSource = _
" Select employeeid, Firstname, department, fullname, birth, hiredon from Employees " & _
" where department is not null " & _
" order by department,firstname "
.BoundColumn = 1
.ColumnHeads = True
.ColumnCount = 6
.ColumnWidths = "0.8 in;0;1.1 in;0.9 in;0;0"
on double click of inputbox event, I added this code:
Dim Emp As String
Dim brth As Date
Dim hiredo As Date
Emp = Me.deptsafetyList.Column(0)
brth = Me.deptsafetyList.Column(4)
hiredo = Me.deptsafetyList.Column(5)
DoCmd.OpenForm "accidentdetail", acNormal
DoCmd.GoToRecord , , acNewRec
Forms!accidentdetail!EmployeeID = Emp
Forms!accidentdetail!birth = brth
Forms!accidentdetail!Hiredon = hiredo
But when I double clicked on listbox, "type missmatch" error appeared.
Could you helped me to solve the problem?
please helped me, I need your help. Many thanks
thank you for the question and sorry: I'm late.
in accidentdetail form:
emp is employeeid textbox (control source is set to employeeid field in accidentdetail table)
brth is birth textbox.
hiredo is hiredon textbox.
Do you want me to post my file for you?
I found the problem:
My code is true (when I double clicked in the listbox, the accident detail form is opened with no problem) if in my listbox (not inputbox, sorry for my typing mistake) birth and hiredon is not null, if one of them is null, "type missmatch" error appeared.
So, how can I handle this error when I double click my listbox, it still open accident detail form, and leave birth and hiredon textbox in this form blank?