Filter ComboBox in sub-subform

captain1974

Registered User.
Local time
Today, 16:21
Joined
Jan 15, 2007
Messages
43
Access 2003.
I'm sure this is possible.:confused:
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
 

Attachments

Have you tried the full specification for the form instead of using the Me shorthand?
 
neileg said:
Have you tried the full specification for the form instead of using the Me shorthand?
This doesn't seem to work, though actually it doesn't give an error message either??
 

Users who are viewing this thread

Back
Top Bottom