filter field from result

G

Guest

Dear Members of Discussion Group :

Here i have some question to ask for help:
I created my database using Ms access
Q1 Given a scenario where USER will enter any keyword in any fields in a
(DealerInfo)SearchForm, then the system must display all the related result
according the keyword been entered. For example, User1 can enter city call"
new york" ,user2 enter "surname" called "john" and finally the system must
able to generate result accoridng any of the keyword been enter.
May i know what are the appropriate code to write? isn 't that i can use
Vbscript and write code in cmdfind button? How? Thank you

Q2 Once the Q1 case been solve, how to do in order to ask the system
LIST/PRINT OUT only the particular field from the search results?For example
how to ask the system list down only particular field eg ' email' of all
company's dealer at city call ' new york' ? eg2 field eg ' email' of all
company's dealer at city call ' new york' with surname called "john" WHICH
WAS ENTERED SINCE Q1.
May i know how to produce this kind of output? What are the codes?
Thank you for your sharing of knowledge.

Miss Elizabeth
 
T

Tim Ferguson

=?Utf-8?B?RWxpemFiZXRoLSBEYXRhYmFzZSBQcm9ncmFtbWluZyBFbnF1aXJ5?=
Q1 Given a scenario where USER will enter any keyword in any fields
in a (DealerInfo)SearchForm, then the system must display all the
related result according the keyword been entered.

The right answer depends on how your tables are structured... It is
usually not hard to create a query to recover the records you want,
something along the lines of

SELECT Something, SomethingElse
FROM MyTable
WHERE City = "New York"
AND Surname = "John"

or whatever.
May i know what are the appropriate code to
write? isn 't that i can use Vbscript and write code in cmdfind
button? How? Thank you

' create the query
jetSQL = "SELECT etc etc..."

' open a report based on the query: check help for the
' parameters you want to use
DoCmd.OpenReport "MyReport",,,jetSQL

Q2 Once the Q1 case been solve, how to do in order to ask the system
LIST/PRINT OUT only the particular field from the search results?

Only include the fields you want to see in the SELECT statement.
For
example how to ask the system list down only particular field eg '
email' of all company's dealer at city call ' new york' ?

SELECT Email
FROM MyTable
WHERE City = "New York"

eg ' email' of all company's dealer at city call ' new york' with
surname called "john" WHICH WAS ENTERED SINCE Q1.

SELECT Email
FROM MyTable
WHERE City = "New York"
AND Surname = "John"
AND Entry > #2006-03-31#


Hope that helps


Tim F
 

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