Hi I'm back asking for help!
I'm creating a simple gage inspection application for our company to use. It's not a complicated application, basic entering of new gages as they are purchased and entering the inspection History for the gages as there checked, also allows users to inquir and see all history for a gage.
Now for the problem. I've attached the code below to a field (Date_aquired) on the gage master file form so that when a gage wheares out or is damaged and they need to replace this gage they will go to date_aquired field and change the date.
(all info for gage should stay the same as the old gage) then my code fires off and calls a forms dialog box that simply asks them to confirm that they are changing date because this is a new gage (yes,No) if yes then I take the gage Id value from the form and do a query over the inspection history file to get only this gages history records. (the thought is that if this is a new gage then all history is irrelevant to this gage and can be gotten rid of ) "THIS IS WERE MY PROBLEMS START" no matter what I try when i fetch thru the inspection hisory file with the query over it so I can delete the gaged history it will delete 2 records out of say five or 3 out of 4 but not all of the records in the query. Ive tried puting in query.order and Ive tried puting index_Primary_put thinking to get my pointers in order but nothing works. I may be doing this completly wrong if so please advise me on what I need to be doing
Thanks in advance
Darrell Payne
___________________Code Below____________________________
debug(1)
dim global last_button as c
tbl = table.current()
gage_Id = tbl.id
IF tbl.mode_get() = 1 Then
:Form.Dialog("msg_new_gage")
Select
case last_button = "Button1"
t=table.open("Insp_History",file_rw_exclusive) query.order = "Insp_History->Id"
query.filter = "Id = gage_Id"
t.query_create()
indx = t.index_primary_put()
t.fetch_first()
while .not. t.fetch_eof()
t.change_begin()
t.delete()
t.change_end()
t.fetch_next()
end while
t.change_begin()
t.delete()
t.change_end()
t.drop()
case last_button = "Button2"
ui_msg_box("Information","would allow change to field")
END Select
END IF
debug(0)
I'm creating a simple gage inspection application for our company to use. It's not a complicated application, basic entering of new gages as they are purchased and entering the inspection History for the gages as there checked, also allows users to inquir and see all history for a gage.
Now for the problem. I've attached the code below to a field (Date_aquired) on the gage master file form so that when a gage wheares out or is damaged and they need to replace this gage they will go to date_aquired field and change the date.
(all info for gage should stay the same as the old gage) then my code fires off and calls a forms dialog box that simply asks them to confirm that they are changing date because this is a new gage (yes,No) if yes then I take the gage Id value from the form and do a query over the inspection history file to get only this gages history records. (the thought is that if this is a new gage then all history is irrelevant to this gage and can be gotten rid of ) "THIS IS WERE MY PROBLEMS START" no matter what I try when i fetch thru the inspection hisory file with the query over it so I can delete the gaged history it will delete 2 records out of say five or 3 out of 4 but not all of the records in the query. Ive tried puting in query.order and Ive tried puting index_Primary_put thinking to get my pointers in order but nothing works. I may be doing this completly wrong if so please advise me on what I need to be doing
Thanks in advance
Darrell Payne
___________________Code Below____________________________
debug(1)
dim global last_button as c
tbl = table.current()
gage_Id = tbl.id
IF tbl.mode_get() = 1 Then
:Form.Dialog("msg_new_gage")
Select
case last_button = "Button1"
t=table.open("Insp_History",file_rw_exclusive) query.order = "Insp_History->Id"
query.filter = "Id = gage_Id"
t.query_create()
indx = t.index_primary_put()
t.fetch_first()
while .not. t.fetch_eof()
t.change_begin()
t.delete()
t.change_end()
t.fetch_next()
end while
t.change_begin()
t.delete()
t.change_end()
t.drop()
case last_button = "Button2"
ui_msg_box("Information","would allow change to field")
END Select
END IF
debug(0)
Comment