B
Bill Phillips
I have a 2 part problem.
I want to use a text box for search criteria to generate a
list box of all the matching records.
1. However I want the initial value of the box to come
from another form AND I would like to be able to edit the
text box before conducting my search.
I tried assigning the value eg:
Me.txtCriteria = Forms!frmNeedToID!ItemID
But I couldn't edit the field. Then I tried On Entry Event:
Me.txtCriteria.Value = Forms!frmNeedToID!Item and this
seems to work as far as the editing problem, but then my
listbox doesn't populate.
2. I will be creating a list box with values that match my
criteria. however, I need to add a wildcard "*" to the end
of my search criteria. If I try to do this in the QBE
behind my list box I get all records. See SQL code shown
below. Also I need the search query to update if I edit
the text box.
SELECT tblItemXrefList.Prod AS ItemID,
tblItemXrefList.Desc1 AS Description,
tblItemXrefList.Desc2 AS [Description 2]
FROM tblItemXrefList
WHERE (((tblItemXrefList.Prod) Like ([Forms]!
[frmFindByItemID]![txtCriteria] & "*")))
ORDER BY tblItemXrefList.Prod;
All help is appreciated.
I want to use a text box for search criteria to generate a
list box of all the matching records.
1. However I want the initial value of the box to come
from another form AND I would like to be able to edit the
text box before conducting my search.
I tried assigning the value eg:
Me.txtCriteria = Forms!frmNeedToID!ItemID
But I couldn't edit the field. Then I tried On Entry Event:
Me.txtCriteria.Value = Forms!frmNeedToID!Item and this
seems to work as far as the editing problem, but then my
listbox doesn't populate.
2. I will be creating a list box with values that match my
criteria. however, I need to add a wildcard "*" to the end
of my search criteria. If I try to do this in the QBE
behind my list box I get all records. See SQL code shown
below. Also I need the search query to update if I edit
the text box.
SELECT tblItemXrefList.Prod AS ItemID,
tblItemXrefList.Desc1 AS Description,
tblItemXrefList.Desc2 AS [Description 2]
FROM tblItemXrefList
WHERE (((tblItemXrefList.Prod) Like ([Forms]!
[frmFindByItemID]![txtCriteria] & "*")))
ORDER BY tblItemXrefList.Prod;
All help is appreciated.