2016-06-18 7 views
0

コンボボックスを使用してサブフォームの名前の検索フィルタを作成しようとしています。 ...それは私が持っている...今クライアント名に依存するが、それは仕事をdoesntのコンボボックスを使用してサブフォームテーブルの名前を検索する

Me.subform.Form.Filter = "[Client]=& me.cboClientName&" 

私はこのような日付命令による検索を行うために管理....

Me.subform.Form.Filter = "[AppointDate]=#" & Format(Me.cbSelectDate, "yyyy-mm-dd") & "#" 

答えて

1

あなたを検索された列とコンボボックスの値との文字列を連結しなければならず、フィルタを適用する必要があります。

Dim strFilter as string 

'first print what you did 
strFilter = "[Client]=& me.cboClientName&" 
Debug.Print "Your faulty filter: " & strFilter ' shown in immediate window 

'now with concat 
strFilter = "[Client]= '" & Me.cboClientName & "'" ' suround by quotes because I assume it's a string 
Debug.Print "filter: " & strFilter 

Me.subform.Form.Filter = strFilter 
Me.subform.Form.FilterOn = true ' activate the Filter 
+0

ありがとうございました。魅力的でした! –

関連する問題