?
Solved

How to use option buttons

Posted on 2003-03-06
13
Medium Priority
?
127 Views
Last Modified: 2013-12-24
How do I search using option buttons? I want the option
button so the user can choose to search the database
either by account number or fund number. How do I link
the search to the option button?
0
Comment
Question by:dgoldsby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
13 Comments
 
LVL 14

Expert Comment

by:hhammash
ID: 8082253
Hi,

It can be done, no problem.

I would like to know more. Do you have 1 search form and 2 DRWs.

I mean if you search by account number then submit ths form it opens a DRW,  but if you search by fund number another DRW opens,  is that right?

hhammash
0
 

Author Comment

by:dgoldsby
ID: 8082654
I'm not sure what a DRW is. I have 1 search form. This database has about 7 columns. I need to be able search the database using any 4 of those columns. The person may only know the account number or the org number therefore they can only search using that information. The same table with the same 7 columns will be displayed no matter which search option the person uses. Does this help?
0
 
LVL 14

Accepted Solution

by:
hhammash earned 200 total points
ID: 8082793
Hi,

Are you using FrontPage and Access?

DRW is Database Results Wizard.  It is when you select Insert/Database Results in FrontPage.  

Anyway I've got a solution and I tried it.  It is working fine.

Create the search form
(Change the names in my example to suite your needs)
----------------------------------------------------
1- Create the search form that has a- Textbox, b- A radio button, c- A radio button.  Now you have 1 Textbox and 2 Radio buttons.

Double click the Textbox and Name it FindNumber

Double click the first Radio and name the group as SelectText. In the value put the name of the page that will display the results by Account Number. (In my example is ByNumber.asp)

Double click the second Radion and name the group as SelectText. In the value put the name of the page that will display the results by Fund number. (In my example is ByFund.asp)

Now Save the form as Search.asp

Now create a new page and call it PointRight.asp and save it.

Go to HTML view of PointRight.asp and erase all what you see,  then post the following code.

<%
DIM MyPage,MyNumber
MyNumber=request.form("FindNumber")
MyPage=Request.form("SelectText")
MyURL=MyPage
Myvarq="?"
MyVar="FindNumber="
MyVal=MyNumber
response.redirect MyPage+Myvarq+Myvar+Myval
%>

Save the page.

Now the SQL of the Result pages:

ByNumber:
---------
SELECT * FROM Accounts WHERE (AccountNumber =  ::FindNumber::)

By Fund:
--------
SELECT * FROM Accounts WHERE (FundNumber =  ::FindNumber::)

Accounts is the name of my table
Account Number is the AccountNumber field
Fund Number is the FundNumber field

The ByNumber SQL will receive the criteria from PointRight.asp and looks by AccountNumber. The ByFund.asp SQL will receive the criteria from the PointRight.asp and looks by FundNumber.

So the user has one search field, he/she can put whatever he/she remembers.

Hope this is what you need.

Let me know if you need more clarification.

hhammash


0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 14

Expert Comment

by:hhammash
ID: 8082867
Hi,

I forgot to mention:

Post your search form to PointRight.asp

Right Click the form
select Properties
Send to Other
Options
In the Action field put PointRight.asp
Press Ok
Press Ok

Regards
hhammash
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8083058
Hi again,

I have a much simpler solution.

Create a form with 1 Textfield only.  Name the text field as FindNumber. Then post your form to the results page.

In the action of the form properties put Results.asp

save the form as Search.asp

Now in the SQL of your Results.asp page put the following:

SELECT * FROM Accounts WHERE (AccountNumber =  ::FindNumber:: OR FundNumber =  ::FindNumber::)

So no matter what they put in the search field either Account number of fund number.  The search result will find it.

Best regards
hhammash
0
 

Author Comment

by:dgoldsby
ID: 8083159
Oh Thank You sooooo much!!:)  It worked!  I've been working on this for so long.  I appreciate it.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8083226
You are most welcome dgoldsby

My best regards
hhammash
0
 

Author Comment

by:dgoldsby
ID: 8083235
Oh Thank You sooooo much!!:)  It worked!  I've been working on this for so long.  I appreciate it.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8083236
Which solution did you like accept?

The first or the second.

Thanks a lot
hhammash
0
 

Author Comment

by:dgoldsby
ID: 8104556
I went with the first solution but i have another question.  What do i do if i want two different groups of radio buttons?  In this database there are 3 different tables. I need to be able to search the same way as above but the user can select from which table they want to search. So i have 2 sets of radio buttons. One set selects which table to search from and the other set selects how you want to search.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8109462
Hi,
The select which table to search from is settled,  but what do you mean by "how you want to search"?

Thanks
hhammash
0
 

Author Comment

by:dgoldsby
ID: 8114252
When I say "how you want to search" I mean search using either the account number or fund number. I need to have the option to select which table i want to search from and then select to search by account number or fund number. I need to use option buttons for all of the above.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8114611
Ok,

That can be arranged,  I will post it for you tomorrow morning.

hhammash
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question