Answer the question
In order to leave comments, you need to log in
How to put a filter in a simple client form of Access DBMS in VBA?
There is a MySQL database .
As a "skin" there is remote work with MySQL tables using the Microsoft Access DBMS . The access is carried out using the odbc driver.
For convenient work on top of the table, an Access form was created using the standard procedure in Access: "Client Forms --> Form" . Wrote several useful baubles on VBA . Everything seems to be working, but at the testing stage the following problem arose:
the standard filter below searches for all the fields of the table. For this reason, the search is incredibly long.
Questions:
1) How to write your own filter in the client form ?
2) Можно ли как-нибудь настроить фильтр по умолчанию на фильтр только по одному полю таблицы?
Искренне прошу прощения, если мой вопрос кому-то покажется глупым. На VBA работаю неделю.
Посоветуйте решения данной задачи.
Answer the question
In order to leave comments, you need to log in
Сам спросил, сам и отвечаю.
Private Sub ExampleObjct_Click()
Dim strSql As String
strSql = "SELECT * FROM some_table WHERE some_field='some_value' order by ID ASC;"
Me.RecordSource = strSql
End Sub
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question