I try explain what I kind of problem I have:
I don't know how:
update (just inserted) record in view and update its base tables
For example:
I've table:
main.dbf
-----
ID USER_ID JOB START_TIME STOP_TIME
1 1 "abc" 01-02-01 12:20 01-02-01 12:40
2 ...
users.dbf
---------
ID NAME
1 "parslej"
2 ....
main_view - My View
-----------
SELECT * FROM main,users WHERE main.user.id=users.id
(updatable fields job, start_time, stop_time, key field:main.id)
In my form I have buttons:
bt_job bt_start
bt_job.click method:
-----------------------
INSERT INTO main_view job VALUES ("abc"
tableupdate(0,.f.,'main_view')
bt_start.click method:
-------------------------
nRec=recno('main_view')
UPDATE main_view SET start=datetime() ;
WHERE recno('main_view')=nRec
tableupdate(0,.f.,'main_view')
But if i 1st click on bt_job, and second bt_start this record vanish
from main_view...
So I must close view (main_view) and it's base tables (main, users)
and again open view as long I don't use bt_job I can click on bt_start
and records update correctly, but if I click on just added record it's
impossible to update it (maybe I should delete it, and second time
insert it ?)
Can You hel me ?
Please - it's very important to me...
Sorry for my English...
I don't know how:
update (just inserted) record in view and update its base tables
For example:
I've table:
main.dbf
-----
ID USER_ID JOB START_TIME STOP_TIME
1 1 "abc" 01-02-01 12:20 01-02-01 12:40
2 ...
users.dbf
---------
ID NAME
1 "parslej"
2 ....
main_view - My View
-----------
SELECT * FROM main,users WHERE main.user.id=users.id
(updatable fields job, start_time, stop_time, key field:main.id)
In my form I have buttons:
bt_job bt_start
bt_job.click method:
-----------------------
INSERT INTO main_view job VALUES ("abc"
tableupdate(0,.f.,'main_view')
bt_start.click method:
-------------------------
nRec=recno('main_view')
UPDATE main_view SET start=datetime() ;
WHERE recno('main_view')=nRec
tableupdate(0,.f.,'main_view')
But if i 1st click on bt_job, and second bt_start this record vanish
from main_view...
So I must close view (main_view) and it's base tables (main, users)
and again open view as long I don't use bt_job I can click on bt_start
and records update correctly, but if I click on just added record it's
impossible to update it (maybe I should delete it, and second time
insert it ?)
Can You hel me ?
Please - it's very important to me...
Sorry for my English...