Hi, I have 2 combo boxes on my form.
First one is employee, you select an employee from my employee query. This then populates a range of boxes such as name etc...
I then have a combo box called payment, which is linked in to my payment query. When a date is selected it populates a range of text boxes with date, payment amount, pension % etc...
What I need to happen is when I select an employee from the employee combo, only the dates that match this employee show in the payment combo, thus eliminating selecting a payment date for the wrong employee.
This is the code I have so far....
Any help?
Thanks
Will
First one is employee, you select an employee from my employee query. This then populates a range of boxes such as name etc...
I then have a combo box called payment, which is linked in to my payment query. When a date is selected it populates a range of text boxes with date, payment amount, pension % etc...
What I need to happen is when I select an employee from the employee combo, only the dates that match this employee show in the payment combo, thus eliminating selecting a payment date for the wrong employee.
This is the code I have so far....
Private Sub CboPaymentDate_AfterUpdate()
Me.TxtGrossPay = Me.CboPaymentDate.Column(7)
Me.TxtExpenses = Me.CboPaymentDate.Column(3)
Me.TxtPaymentID = Me.CboPaymentDate.Column(1)
LngPaymentID = Me.TxtPaymentID
End Sub
Private Sub CboEmployees_AfterUpdate()
Me.TxtNI = Me.CboEmployees.Column(2)
Me.TxtBand = Me.CboEmployees.Column(3)
Me.TxtPensionRate = Me.CboEmployees.Column(4)
Me.TxtPCT = Me.CboEmployees.Column(5)
Me.TxtNonCont = Trim(Me.CboEmployees.Column(6) & " ")
Me.TxtID = Me.CboEmployees.Column(0)
Me.CboPaymentDate.RowSource = "Select DateofSession From QryHistory Where GPID =" & Me.CboEmployees & " Order By DateofSession DESC;"
LngEmployeeID = Me.TxtID
End Sub
Any help?
Thanks
Will