Chuck
Chuck

Reputation: 1226

Loading certain records to a form from a table

So far I have a table with all of the customers information and a form that has all the bound fields. I have a field that has a membership expiration date on it. I want our call center to be able to see which customers membership will expire in the next "x" days/months so they can call to see if they would like to renew.

What I would like to know is if there is a way to get the form to only show those customers and not the entire database and if not maybe to start by showing the closest membership to expiration and work from there.

I am sorry I have no code to show how far I am but I have no idea how to start this procedure and all of my code is just checks to ensure saving of fields and other cosmetic stuff.

Any help in this matter would be greatly appreciated.

Thanks in advance!

Upvotes: 0

Views: 45

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123409

One approach would be to put a button on your form (say, on the Form Header) that could set the .Filter property of the form and then toggle filtering on, something like this:

Private Sub btnFilterForExpiryWithin90Days_Click()
Me.Filter = _
        "[MembershipExpiryDate] Between #" & _
            Format(Now(), "yyyy-mm-dd") & _
            "# And #" & _
            Format(DateAdd("d", 90, Now()), "yyyy-mm-dd") & _
            "#"
Me.FilterOn = True
End Sub

Upvotes: 1

Related Questions