Recording value so it's not lost when button is clicked with timer event, timing is set to 500
Private Sub Form_Timer()
value = Me.EID.value
End Sub
I passed the value using DoCmd.OpenForm last argument.
Private Sub trainings_Click()
On Error GoTo trainings_Click_Err
' _AXL:<?xml version="1.0" encoding="UTF-16" standalone="no"?>
' <UserInterfaceMacro For="show_trainings" xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application"><Statements><Action Name="OpenForm"><Argument Name="FormName">Employee
' _AXL:Trainings</Argument><Argument Name="WhereCondition">="[ATTUID]=" &"'" &[ATTUID] & "'"</Argument></Action></Statements></UserInterfaceMacro>
DoCmd.OpenForm "Add Training", acNormal, "", "", , acNormal, value
trainings_Click_Exit:
Exit Sub
trainings_Click_Err:
MsgBox Error$
Resume trainings_Click_Exit
End Sub
and at last I read the Argument and set the Combo box value and for the dependent listboxes I called requery
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Me.cboEmp = Me.OpenArgs
Me.List14.Requery
Me.List18.Requery
End If
End Sub