Good day all. It's been a while.
Issue:
Form "frmLabsBuildFieldExamCards"
Unbound Text Box "txtFindName"
Unbound List Box "LstPossibleChoices" with Row Source bound to a query "SELECT [qryLabsBuildFieldExamCards].[Name] FROM qryLabsBuildFieldExamCards;"
Cmd Button with this code:
Private Sub Command10_Click()
Dim DB As DAO.Database
Dim QD As QueryDef
Dim where As Variant
Set DB = CurrentDb()
On Error Resume Next
DB.QueryDefs.Delete ("qryLabsBuildFieldExamCards")
On Error GoTo 0
where = Null
where = where & " AND [Name]Like '" + Me![txtFindName] & "*'"
Set QD = DB.CreateQueryDef("qryLabsBuildFieldExamCards", "Select * from qryLabsFieldExam " & (" where " + Mid(where, 6) & ";"))
'DoCmd.OpenQuery "qryLabsBuildFieldExamCards"
'Me!LstPossibleChoices.Requery
'Forms!frmLabsBuildFieldExamCards!LstPossibleChoices.Requery
**************************
My eventual intent is to pass the results (using Mulit-Select) to another list box "LstActualChoices". However the Requery is not working as I thought it would. the text is passed to the query as expected, but the list box does not show the filtered results.
I have to close then open the form to see the change. Looking at other strings on this form I would have expected Requery to do the trick....what am I missing?
PS I tried using it on the list box but no go.
Thanks in advance.
Issue:
Form "frmLabsBuildFieldExamCards"
Unbound Text Box "txtFindName"
Unbound List Box "LstPossibleChoices" with Row Source bound to a query "SELECT [qryLabsBuildFieldExamCards].[Name] FROM qryLabsBuildFieldExamCards;"
Cmd Button with this code:
Private Sub Command10_Click()
Dim DB As DAO.Database
Dim QD As QueryDef
Dim where As Variant
Set DB = CurrentDb()
On Error Resume Next
DB.QueryDefs.Delete ("qryLabsBuildFieldExamCards")
On Error GoTo 0
where = Null
where = where & " AND [Name]Like '" + Me![txtFindName] & "*'"
Set QD = DB.CreateQueryDef("qryLabsBuildFieldExamCards", "Select * from qryLabsFieldExam " & (" where " + Mid(where, 6) & ";"))
'DoCmd.OpenQuery "qryLabsBuildFieldExamCards"
'Me!LstPossibleChoices.Requery
'Forms!frmLabsBuildFieldExamCards!LstPossibleChoices.Requery
**************************
My eventual intent is to pass the results (using Mulit-Select) to another list box "LstActualChoices". However the Requery is not working as I thought it would. the text is passed to the query as expected, but the list box does not show the filtered results.
I have to close then open the form to see the change. Looking at other strings on this form I would have expected Requery to do the trick....what am I missing?
PS I tried using it on the list box but no go.
Thanks in advance.