Hi, I have limited knowledge of the code for Access so go easy on me.
I have a main form [Form1] with a combo box [cboFSE] which i want to use to filter the sub form [F2], the sub form is taking the data from a query [TradeUpcomingPeriodLYAllAccDetails], the combobox is taking data from an embedded query.
I've used the below code for the same use before except the sub form was taking data from a table. Now that i have changed it to fit my new data etc it keeps returning an error with recordsource, I'm completely stuck and no idea what to do to fix it.
Thanks in advance for any help
Sub setfilter()
Dim F As String
F = "select * from TradeUpcomingPeriodLYAllAccDetails"
F = F & " where FSE = '" & cboFSE & "'"
Form_F2.RecordSource = F
End Sub
Private Sub cboFSE_afterUpdate()
'Call subroutine to set filter based on selected FSE
setfilter
End Sub
Private Sub Form_Open(Cancel As Integer)
'Call subroutine to set filter based on selected FSE
setfilter
End Sub