Create Query to find records and display in pre-existing form?

R

RemySS

Hi All,

I have an existing form which contains various building sites with their own
site ref numbers and upgrade numbers. The buildings have maintenance work
carried out on them, with each work assigned a unique upgrade number so if a
site has had previous works, there will be multiple unique upgrade numbers
(along with other fields with other info) for the same site (there is never a
duplicate upgrade number).

I would like to run a keyword search (similar to a search engine) query or a
query from a command button.

The query should ask for the site ref and/or upgrade number and/or the
region (North or South) and display the resulting records in the same form. I
have tried to do this in the query option in Access using SQL - with no luck.

Could anyone help me on this? I'm a bit of a novice at queries but have some
experience in VB.

Thanks in advance
 
M

[MVP] S.Clark

You can change the forms recordsource on the fly with:

Me.Recordsource = "Select * from tablename where fieldname = value"

So, when the user clicks the button, parse the criteria string, and update
the recordsource property

--
Steve Clark, Access MVP
FMS, Inc.
Call us for all of your Access Development Needs!
1-888-220-6234
[email protected]
www.fmsinc.com/consulting
 
R

RemySS

S.Clark,

Thank you, but could you possibly elaborate further as my experience of VB
doesnt extend that far and I'm struggling!

Thanks Again
 
Top