Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Forums  Contact  Privacy  Links
Application Object Examples
Build Criteria VBA Example

Visual Basic Application Objects

 





Access Error
AddToFavorites
BuildCriteria
CloseCurrentDatabase
CodeDB
CompactRepair
ConvertAccessProject


BuildCriteria Method Example


BuildCriteria Method - The BuildCriteria method returns a criteria string as it would appear in the criteria line in the query design grid. For example, you may want to set a form's Filter or ServerFilter property based on varying criteria from the user. You can use the BuildCriteria method to construct the string expression argument for the Filter or ServerFilter property.

The BuildCriteria Method has the following structure:

strVar = BuildCriteria (fieldname, fieldtype, expression)

where:

fieldname is the name of the field in the record source of the form.

fieldtype is an integer constant for the data type of the field. 
The field type can be any of the following constants:



Microsoft Access is a fully capable database and it's primary limitations is the number of concurrent users it will support. Generally, we recommend a limit of 10 to 15 users.

We create databases large and small. Some of our databases help run entire small businesses. We also handle unique businesses such as flyrod manufacturing, cheese making, marina management, and cable tv inventory.


  • dbDate

  • dbText

  • dbBoolean

  • dbInteger

expression is string containing the criteria.

Here's an example:

Sub BuildCriteria_Click
Dim strCriteria As String

strCriteria = BuildCriteria ("OrderDate", dbDate, ">1-1-95")

End Sub

This example returns the following criteria string:

OrderDate>#1/1/95#








A Blue Claw Database Design Article:

Why Choose Microsoft Access
 





Blue Claw Database Design Downloadable Tutorial:
Download Continuous Form Dependent Combo Box  





A Blue Claw Software Design Template:

Customer Relationship Management (CRM) Template
 



Contact Information

Copyright 2000-2017 Blue Claw Database Design