perameter query help

G

Guest

I asked this question about a year ago but the answer (and question) seems to
have been deleted.
I am creating a parameter query in which I want to be able to search
variables of the same search. EG when searching the term ‘One’ I want to
find all returns in a given field with variables such as One, One HA, One
Housing, One Housing Association etc. As far as I recall the answer is to
insert a criteria looking something like (*) or (*?*) but none of the
permutations I have on these seems to work. Any replies will be appreciated

Regards

Clive
 
G

Guest

Clive:

Use the like operator and * wildcards like so:

Like "*" & [Enter string:] & "*"

If you really do have variations on the same name of an organisation in
different rows of a table it suggest that your table is not normalized. With
the example you have given the One Housing Association's name should be
stored in a single row of an Organisations table for instance, with the
primary key of this table (which could be an autonumber for convenience)
referenced by a foreign key column in the referencing table. That way there
is no opportunity for discrepancies. To get the names just join the tables
in a query as the RceordSource of a form or report.

For a parameter query the parameter could then be an unbound combo box on a
dialogue form so the user simply selects from the list and opens the query,
or far better, a form or report based on it with button on the form.

Ken Sheridan
Stafford, England
 
G

Guest

PARAMETERS TBL Text ( 255 ), ExtKey Text ( 255 ), LAN Long;
SELECT tblDocReferencesEst.*
FROM tblDocReferencesEst
WHERE (((tblDocReferencesEst.txtTableName)=[TBL]) AND
((tblDocReferencesEst.txtExternalKey)=[ExtKey]) AND
((tblDocReferencesEst.enmLAN)=[LAN]))
ORDER BY HyperlinkPart([hyperDescription],1);

Private db As DAO.Database
Private qdf As DAO.QueryDef
Private rstLink As DAO.Recordset

Set db = CurrentDb
Set qdf = db.QueryDefs("qryDocReferenceUpdate")
qdf.Parameters("TBL") = vTableName
qdf.Parameters("ExtKey") = vEntityKey
qdf.Parameters("LAN") = enLAN
Set rstLink = qdf.OpenRecordset
 

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