Rui Nunes
|
| Posted: 01/08/2003, 4:58 PM |
|
I have to insert same record in two columns of the access database. I use CodeCharge.
When i insert or update the record "Phone" the value "X" of the "Phone" go to the table "Clients", column "Phone_a" and "Phone_b" to MSAccess database.
EX: I insert the phone 999999999 and this number go to the table "Clients",
Columns "Phone_a" and "Phone_b"
Can anyone could help me please.
I past 1 week seach how to make this.
Thank you!
|
|
|
 |
Edd
|
| Posted: 01/08/2003, 5:41 PM |
|
Create 2 hidden fields for Phone_a and Phone_b.
Create Events BeforeUpdate and BeforeInsert for the form, with your own code.
Populate the Phone_a and Phone_b fields as you see fit.
Hope this helps.
Edd
|
|
|
 |
Rui Nunes
|
| Posted: 01/09/2003, 2:12 AM |
|
I dont know how to create Events BeforeUpdate and BeforeInsert for the form.
Can you help me?
|
|
|
 |
John Ramsden
|
| Posted: 01/09/2003, 2:44 AM |
|
To create events for the form, go into Design mode, click on the opening
arrow thingie for the form (in other words, highlight the form).
Then, if the properties window isn't already visible, click on the "hand holding a clipboard" icon to make it so. Then, in this window click on
the Events tag, and under the "Server" tree right-click on the required
event, e.g. BeforeUpdate, and click on "Add Code". (I'm not clear what
the other option, "Add Action", does or even means!)
Taking PHP as an example (I haven't used any other language with CCS),
if your PHP script for the page is called fred.php there should now be,
if not already, a second script called fred_events.php, in which you
can replace the commented out lines "CODE HERE" with your required
code.
(But don't delete or move any comment lines containing strange-looking
alphanumeric "keys", as CCS uses these to tie up the code in some
way. If you have to start the page again, you can't even replace
fred_events.php wholesale but must redefine each event function
individually to get a new set of keys.)
HTH
Cheers
John Ramsden
|
|
|
 |
Rui Nunes
|
| Posted: 01/09/2003, 3:52 AM |
|
Dear John Ramsden
I dont use Code Charge Studio. I only have Code Charge.
Any way, thank you for you time.
|
|
|
 |
|