captain1974
Registered User.
- Local time
- Today, 16:21
- Joined
- Jan 15, 2007
- Messages
- 43
Access 2003.
I'm sure this is possible.
I have attached 2 examples. Example2 (form: HarvestVineyard) was my database form before I realised that I couldn't have all my subforms on the main form if I wanted to add new records to the most junior subform. However, the filter does work very well, only the blocks are displayed that are particular to the vineyard selected at the top of the form. The example1 (frmVineyard) is the current form I am working on (thanks to MStef) which will allow me to enter data into the all subforms. However, the filter will not work on this one. If someone could point out where I am going wrong I would be very grateful. I am thinking it is to do with the Me.Parent reference in the subform???
I'm sure this is possible.
I have attached 2 examples. Example2 (form: HarvestVineyard) was my database form before I realised that I couldn't have all my subforms on the main form if I wanted to add new records to the most junior subform. However, the filter does work very well, only the blocks are displayed that are particular to the vineyard selected at the top of the form. The example1 (frmVineyard) is the current form I am working on (thanks to MStef) which will allow me to enter data into the all subforms. However, the filter will not work on this one. If someone could point out where I am going wrong I would be very grateful. I am thinking it is to do with the Me.Parent reference in the subform???
Code:
Private Sub Form_frmBlockHarvest_ApplyFilter(Cancel As Integer, ApplyType As Integer)
sBlockSource = "SELECT [tblBlock].[VineyardID], [tblBlock].[BlockName], [tblBlock].[Variety] " & _
"FROM tblBlock " & _
"WHERE [VineyardID] = " & Me.Parent.Form_frmVineyard.cboVName.Value
Me.cboBN.RowSource = sBlockSource
Me.cboBN.Requery
End Sub