My Assistant
![]() ![]() |
|
|
Feb 6 2012, 07:05 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 179 |
I want to set the criteria of a query by the use of a combo box. I'm not sure where to begin with this... Can anyone point me in the right direction?
|
|
|
|
Feb 6 2012, 07:25 AM
Post
#2
|
|
|
UtterAccess Editor Posts: 6,719 From: Capital District, NY, USA |
Hi,
Depending on the context, a few ways would be to use the Expression Services to reference the combo from your query: CODE SELECT * FROM SomeTable WHERE SomeField = [Forms]![FormName]![ComboBoxName] or maybe use the AfterUpdate event of the combo to build a dynamic SQL statement: CODE Dim strSQL As String strSQL = "SELECT * FROM SomeTable WHERE SomeField = """ & Me.ComboBoxName & """" someobject.Recordsource = strSQL hth |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 24th May 2013 - 05:35 AM |