Question Search Criteria

brp

Registered User.
Local time
, 19:28
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
 
Allen's example shows how to use two textboxes to input a search range.
 
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

Back
Top Bottom