Question Search Criteria (1 Viewer)

brp

Registered User.
Local time
Today, 07:38
Joined
Mar 26, 2012
Messages
13
I have created Allen Browne search criteria form. In the main form, there are many field like text, number, currency and Year. Year is selected by drop down combobox in the following vba and works fine.

Dim strYears As String, intCounter As Integer
For intCounter = 0 To 20
strYears = strYears & Year(Date) - intCounter & ";"
Next intCounter
strYears = Left(strYears, Len(strYears) - 1)
Me.PurchasedYear.RowSourceType = "Value List"
Me.PurchasedYear.RowSource = strYears

The problem is I have no idea how to write vba to filter criteria;
1) in between two years.
2) criteria in between two currency values
3) criteria in between two number fields

Any help for the above is highly appreciated.

Buddhika
 

June7

AWF VIP
Local time
Today, 06:38
Joined
Mar 9, 2014
Messages
5,468
Allen's example shows how to use two textboxes to input a search range.
 

Cronk

Registered User.
Local time
Tomorrow, 00:38
Joined
Jul 4, 2013
Messages
2,772
Code:
Dim strMonths As String, intCounter As Integer
For intCounter = 1 To 12
    strMonths = strMonths & format(dateserial(1, intCounter,1),"mmmm") & ";"
Next intCounter
strMonths = Left(strMonths , Len(strMonths ) - 1)
Me.PurchasedMonth.RowSourceType = "Value List"
Me.PurchasedYear.RowSource = strMonths
 

Users who are viewing this thread

Top Bottom