Search Forms:

A

Ayelet

Hi,

First, always use "&" to concat strings, i don't think "+"
will achieve the desired affect.
Also, I think if you use the "Search" command (RunCommand -
acCmdFind) and choosing "Any Part of field should do the
trick.
you could use the Requery command to get the form to
update.
you could use something like
LIKE "*" & [EmptyTextBox] & "*"
in the criteria field of the query, it should work, but
you can also check the query step by step and you might
find the problem. (just run the query and see if you get
the results you want).
I think the best way to implement what you're describing,
is to have the customer's detils on the Detailssection of
the form, with an unbound (=Empty) text box at the header,
with an AfterUpdate event (or a command btn's Click event,
as you like), and attach this code to it (it's an Event
Procedure)
'Code Starts
Private Sub FilterText_AfterUpdate()
Me.Filter = "[CustomerName] Like ""*" & Me![FilterText]
& "*"""
End Sub
'Code Ends

HTH,
Ayelet

-----Original Message-----
Hi Guys,

Please be a bit gentle here as I'm a complete novice with Access, I've been
plodding along steadily on my own for a while and now I'm stuck - hopefully
somebody here can give me a few hints on where to go (politely please ;-) )
and what to do next.

I have a table (let's call it CustomerDetails for the sake of ease).
I have a form which I've created (let's call this one CustomerSearch). The
idea behind this form is that there is an empty text box at the top of it
and when somebody wants to search for a specific surname from the
CustomerDetails table they enter the name, or part of it, into the text box
and click on a button and the results of this search will be displayed in a
subform at the bottom of the main form (let's call this CustomerSearchSub).
Ideally when the main form is first opened it should display all of the
different customers from the CustomerDetails table in the CustomerSearchSub
form and then the list should be cut down as the search is carried out.

I've tried basing the subform on a query that looks up the value the user
enters in the text box, I've tried all sorts of different commands in the
macro builder to get the thing to update, I'm having problems getting
wildcards to work (I tried using criteria: Like
[Forms]![CustomerSearch]![EmptyTextBox]+"*" and it went away and thought for
a while and then I got no results at all (I'm sure the wildcards things
don't work like that!!!)

Any help please would be gratefully received, I'm sure I saw an answer to a
question similar to this a while back but I can't find it now.

Thanks in advance,

Raist.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/03


.
 
R

Raistlin

Hi Ayelet,

Excellent, thanks very much for that. It was the Syntax that I was having
the problem with.

I managed to get the underlying query running correctly using the
suggestions you gave and everything sort of fell into place after that.

Thanks again,

Raist.

<SNIP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top