Joe Was
MrExcel MVP
- Joined
- Feb 19, 2002
- Messages
- 7,539
I have a forn with Fields, a DropDown and a ListBox. Ithe ListBox shows the Key field for the table only. If you select a key [Word] from the ListBox the form shows that records fields.
The DropDown lists the possible values for a non-key field in the table [Type]. If you select a [Type] from the DropDown only records containing that [Type] are selected with the "Next" button.
The problem is the ListBox still shows the complete Table when a Filter is on but only go's to record of the selected [Type]. I would like the ListBox to only show the Key field records where that record contains the Filtered [Type] record rather that the complete table?
Any ideas?
This is a sample of the code that filters the Table, for one [Type] based upon the forms selected DropDown [Type]:
Private Sub ShowDropDown_AfterUpdate()
If Me.ShowDropDown = "Temperature" Then
DoCmd.ShowAllRecords
DoCmd.ApplyFilter , "Type = 'Temperature'"
End If
DoCmd.Requery "ListBox_Lookup"
Me.Repaint
DoCmd.Restore
End Sub
The DropDown lists the possible values for a non-key field in the table [Type]. If you select a [Type] from the DropDown only records containing that [Type] are selected with the "Next" button.
The problem is the ListBox still shows the complete Table when a Filter is on but only go's to record of the selected [Type]. I would like the ListBox to only show the Key field records where that record contains the Filtered [Type] record rather that the complete table?
Any ideas?
This is a sample of the code that filters the Table, for one [Type] based upon the forms selected DropDown [Type]:
Private Sub ShowDropDown_AfterUpdate()
If Me.ShowDropDown = "Temperature" Then
DoCmd.ShowAllRecords
DoCmd.ApplyFilter , "Type = 'Temperature'"
End If
DoCmd.Requery "ListBox_Lookup"
Me.Repaint
DoCmd.Restore
End Sub