CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Radio button update other table

Print topic Send  topic

Author Message
Phil
Posted: 04/21/2004, 5:30 AM

Hello,

I have an radio button like this:
0 option 1
0 option 2
0 option 3
0 option 4

After update, I want to update an other table then the table with the radio button 'options'. In the properties of the radio button it is possible to set the control source but only for an field of the same table and not of an different table.

Is there someone who knows how to do it in CCS or do I need to write some script and are there examples or other topics.

Kind Regards,
Phil
Phil
Posted: 04/21/2004, 7:26 AM

With custom update I have connection with the other table because there is an update but I want to insert an field not update. When I change my update button to on insert button the button is totally gone..
peterr


Posts: 5971
Posted: 04/21/2004, 12:18 PM

You can automatically update and insert records only into the same table that is specified in the data source of the form. The "Insert" button should be hidden if the record is found, or otherwise the database would generate an error because it cannot create two records with the same key.

To do what you described you could probably:
1. Use "Custom Insert" and "Custom Update" properties and specify there which table you want to update and which controls to use.
Not sue if this will work for you because it's quite unusual to display record from one table but insert into another (therefore users may not see the Insert button).

or
2. Use custom code as shown in the 3 "Working with Multiple Selections
" examples in CCS Example pack.

3. Implement your solution differently. Try describing the goal instead of the solution that you think you may need.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Phil
Posted: 04/22/2004, 12:18 AM

It must be like a poll. One question and then 4 answers with the radio buttons. The question and answers are in table1 and I want to insert the answer in table2.

Table1:
ID Name Question
1 How old are you? 0
2 10-20 1
3 21-30 1
4 31-50 1
5 50+ 1

I use the Parent/Child structure because I want to make an quiz with more then one question. But first I have to solve this problem and make it work with one question.

I hope you can help me! And don't think I'm the first making an Poll with CCS :-)

Phil
peterr


Posts: 5971
Posted: 04/22/2004, 1:06 AM

Thanks. This clarifies a bit.
In this case I see two approaches:
1. Use the "Update" button (just rename it to Insert or Submit if you like), so that your 1st table is updated (for example with "last_answer_date"), or you can disable the database update in the Before Update event ( http://docs.codecharge.com/studio/html/Components/RTPro...ateAllowed.html ). Then in the same Before Update event insert the record into your 2nd table via custom code as shown in our "Many-to-Many" examples, or at http://docs.codecharge.com/studio/html/ProgrammingTechn...eCustomSQL.html

or
2. Use the 2nd table (responses) as your Data Source for the Record form. Then your Insert button will work OK and should automatically insert the record into the 2nd table. You would only need to display the list of possible answers and this can be done by assigning your 1st table as the Data Source for the Radio Button, or by using some custom code in the Before Show event, or even by modifying the SELECT statement in the "Before Execute Select" statement: http://docs.codecharge.com/studio/html/ProgrammingTechn.../ModifySQL.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Phil
Posted: 04/22/2004, 1:40 AM

Tnx Peter, option 2 is fast and I solved the problem in 5 minutes :-D

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.