Client_DoB is Date Data Type. dd/mm/yyyy
I would like the subfrm filtered by the month in the combo box when selected
to reflect birthdays in November for example. I would also like Happy
Birthday to reflect Age + 1 but only if the curent date is < the DoB. Can you
help with VBA please...thanks
To retrieve only those records with birthdays in whatever month has been
selected in cboMonth, add a computed field Format([Client_DoB], "mmmm") to
your query, and set Forms!frmBirthsdays!cboMonth as its criteria. In the
AfterUpdate event of the combo box, put code to requery the subform:
Me.NameOfSubformControl.Form.Requery. Make sure that you use the name of the
subform control on the form: depending on how you added subfrmBirthdays as a
subform, the name of the control might not be subfrmBirthdays.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Chuck" <Ch...@discussions.microsoft.com> wrote in message
news:D63B18B1-E4DC-46E3...@microsoft.com...
Me!NameOfSubformControl.Form.Requery
End Sub
It may well be that the subform control on the main form is also named
subfrmBirthdays, in which case the line would be
Me!subfrmBirthdays.Form.Requery
However, only you can determine that.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Chuck" <Ch...@discussions.microsoft.com> wrote in message
news:4490DEFB-B053-4EB8...@microsoft.com...
Once I've filtered the month, now i want to sort the Client_DoB field by dd
ascending so 01-Dec-1948 is first, 02-Dec-1980 is second etc. How do i do
that as part Case1 below?
Private Sub Filter_Click()
Dim FrmS As Access.Form
Set SF = Me.[subfrmBirthdays].Form ' Reference the Subform through it's
*control*
Select Case Me.[BirthdayFilterOpt].Value
Case 1 ' Sort by Day
SF.OrderBy = ??????
SF.OrderByOn = True
Case 2 ' Sort by Gender
SF.OrderBy = "[Gender] ASC"
SF.OrderByOn = True
Case 3 'Sort by Last Name
SF.OrderBy = "[Last_Name] ASC"
SF.OrderByOn = True
End Select
End Sub
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Chuck" <Ch...@discussions.microsoft.com> wrote in message
news:C49D31C8-2BB8-4643...@microsoft.com...
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:%23qkajp2...@TK2MSFTNGP02.phx.gbl...