[Solved] Query to a push button in a form possible?

Creating and using forms
Post Reply
Rumor
Posts: 2
Joined: Sat Jan 17, 2009 5:33 am

[Solved] Query to a push button in a form possible?

Post by Rumor »

Greetings all. Thank you for taking time to read this and for any help you can give.

I am very rusty in database design and am building one as a favor for a long time friend. He needs what amounts to an address book on steroids. I've got the main table done and am designing a form to enter / display the data.

He will have need to search the records by area code or by zip code. I've written the queries which prompt the user to enter the search criteria and then return the relevant records. What is stumping me is making those queries available from the main form. I thought I could just stick a button on the form, assign a query to it and that'd be that. However, I am stumped as to how one goes about assigning a query to a button if it is at all possible.

What I want to do is make it so that if he needs to search the records for all those who are in area code 212, he clicks a button, gets prompted to enter the area code, clicks ok and has the data presented to him to page through. How do I assign SELECT * FROM "tbl_vendors" WHERE "Office Phone" LIKE :Area_Code_Percent to a button? Is there some other better solution that I am overlooking?

I am working in OOo 3.0.0 build 9358 in Arch Linux.

Thanks again for your time!
Last edited by Rumor on Sat Jan 17, 2009 8:45 pm, edited 1 time in total.
OOo 3.0.X on Linux-Other
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Is assigning a query to a push button in a form possible?

Post by Villeroy »

All the form design tools on one toolbar to create forms, subforms, lists and nested lists for all kinds of relations and referencial integrity.
1. The built-in form based filter where a user can compose arbitrary complex filters.
2. Forms and controls can be bound in several ways, so a helper-table stores the filter criteria (which can also help to load another form or report based on the same criteria): [Solved] SQL criteria from a Combo Box value
3. Quite a lot of macro-code has been written to do the trick with unbound combo/list boxes.
SELECT * FROM "tbl_vendors" WHERE "Office Phone" LIKE :Area_Code_Percent
4. You can bind your form to such parameter query and add a button with property "Action" = "Refresh Form". You'll be prompted for input then.

Just another example of a bound combo-filter with pictures: http://user.services.openoffice.org/en/ ... hp?id=3371
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Rumor
Posts: 2
Joined: Sat Jan 17, 2009 5:33 am

Re: [Solved] Query to a push button in a form possible?

Post by Rumor »

Villeroy,
Thank you for the links and information. I was able to resolve the matter with your help.
Post Reply