Sheogorath
asked on
Selecting Dates and displaying related fields via Combobox
Hi I would like to select dates from my table via combo box and display the related information on the Split form's datasheet.
For example I have the below data in the table:
date name code
05/01/2011 John Smith A
05/01/2011 Jane Smith B
05/15/2011 George Ellis A
05/15/2011 Jane Smith K
So when I select from my combobox the date of 05/01/2011 I only would like to see the below information in the datasheet.
05/01/2011 John Smith A
05/01/2011 Jane Smith B
Any help will be greatly appreciated.
For example I have the below data in the table:
date name code
05/01/2011 John Smith A
05/01/2011 Jane Smith B
05/15/2011 George Ellis A
05/15/2011 Jane Smith K
So when I select from my combobox the date of 05/01/2011 I only would like to see the below information in the datasheet.
05/01/2011 John Smith A
05/01/2011 Jane Smith B
Any help will be greatly appreciated.
Oops, saw one error in above post, dealing with a Date Field, you need hashes:
Dim strFilter As String
strFilter = "[DateFieldName]=#" & Me.ComboboxName & "#"
Forms![YourMainFormName]![ YourSubFor mName].Fil ter = strFilter
Forms![YourMainFormName]![ YourSubFor mName].Fil terOn = True
HTH,
Daniel
Dim strFilter As String
strFilter = "[DateFieldName]=#" & Me.ComboboxName & "#"
Forms![YourMainFormName]![
Forms![YourMainFormName]![
HTH,
Daniel
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks.
As a follow up, you can simply create a table of all "available" dates, and update it periodically.
You can auto-fill sequential dates in Excel quite easily...
;-)
As a follow up, you can simply create a table of all "available" dates, and update it periodically.
You can auto-fill sequential dates in Excel quite easily...
;-)
In the AfterUpdate event of your Combobox, try something like this:
Dim strFilter As String
strFilter = "[DateFieldName]=" & Me.ComboboxName
Forms![YourMainFormName]![
Forms![YourMainFormName]![
HTH,
Daniel