Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Code to do a Search works good except when I

Status
Not open for further replies.

Margah

Programmer
Mar 21, 2004
15
US
Like "*" & [Forms]![Transfer]![SearchFilter] & "*"

The above expression in the Critera in the query works good for finding text. but when i enter numbers it crashes any ideas.
 
ok what if it is a mix of Numbers and letters what would I use.
 
Provided the column in the table isn't defined as numeric, the Like comparison should work.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

Great it sees all records that have the paramters that I set in the search but when i try to pass the value of the field that I want I get a

Data Type Mismatch in Criteria Expression


 
but when i try to pass the value of the field that I want
Can you please post how you do that ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
OK. I will try.

Here is the Form itself

TransferID
JobNumber
Customer
Date
PoNum
Description
Qty
CostCode

The Customer field is auto filled by the job Number and the description is auto filled by the partnumber the date is a default date

I have two more unbound text boxes the first is the

SearchFilter (or criteria)
on the after update event for it I have

me.PoNumFilter.Requery
me.Requery


The Second is a list Box is

Results of the Search

Under AfterUpdate event I have

Dim rs as object

Set rs = me.Recordset.clone
rs.FindFirst "[TransferID] = " & me.PoNumFilter
me.BookMark = rs.BookMark
me.PoNumFilter = Null
me.PoNum.SetFocus


on the query under PoNum I have this

Like "*" & [Forms]!Transfer]![SearchFilter] & "*"


The search comes up and works fine But I am tring to auto fill the part number from the Serch result.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top