Hi all,
After building the main structure of my database and tested ok I then went on to add more.
While going back through and testing new additions I then noticed that my main entry form was not saving changes to it.
I am pretty sure it did before although not 100% sure.
No changes were made to any of the save buttons or the forms Oninit scripts but new records save fine but if you go back into a record to change it it just reverts back to what it was before the change?? If I change the record via the default browse it works fine. Aaaah help.
The idea is that when they enter the form they select 1 of a few buttons which then either puts form into enter mode only or change mode only and goes from there. The script to tell form which mode to be in is on the Oninit of the form as below.
''XBasic
this.maximize()
DIM GLOBAL Menu_Selector AS C
DIM GLOBAL Curr_Quote_No AS C
DIM GLOBAL From_QL AS C
this.restrict_navigation=.t.
this.restrict_delete=.t.
If Menu_Selector="EDIT" then
this.restrict_enter=.t.
this.restrict_change=.f.
Script_Play("Edit Quote Hide / Show")
parentform:Text13.text="EDITING QUOTE"
parentform:Text13.refresh()
parentform:Button26.activate()
If From_QL="FROM" then
topparent.index_set("Quote_No")
topparent.find(Var->Curr_Quote_No)
parentform:Cust_Id.activate()
From_QL="NOTFROM"
Else
parent.resynch()
End If
Else
parentform:Text13.text="ENTERING NEW QUOTE"
parentform:Text13.refresh()
this.restrict_enter=.f.
this.restrict_change=.t.
Script_Play("New Quote Hide / Show")
parentform.new_record()
If Menu_Selector="NEW" then
Script_Play("Open Cust Manager")
Else
End if
End if
End
So if they enter the form to edit a record Menu_Selector variable would be 'EDIT'.
This all works and has done for a while except when I push a button to exit or save etc even a simple parent.commit() button and then it doesnt save changes.
The form itself has all the allow change/new etc ticked off.
Is this a simple mistake I have made in scripting or could something else have affected it - like maybe indexes or ???
Help would be appreciated as I am lost - it should be simple surely :)
Mike Lyon
After building the main structure of my database and tested ok I then went on to add more.
While going back through and testing new additions I then noticed that my main entry form was not saving changes to it.
I am pretty sure it did before although not 100% sure.
No changes were made to any of the save buttons or the forms Oninit scripts but new records save fine but if you go back into a record to change it it just reverts back to what it was before the change?? If I change the record via the default browse it works fine. Aaaah help.
The idea is that when they enter the form they select 1 of a few buttons which then either puts form into enter mode only or change mode only and goes from there. The script to tell form which mode to be in is on the Oninit of the form as below.
''XBasic
this.maximize()
DIM GLOBAL Menu_Selector AS C
DIM GLOBAL Curr_Quote_No AS C
DIM GLOBAL From_QL AS C
this.restrict_navigation=.t.
this.restrict_delete=.t.
If Menu_Selector="EDIT" then
this.restrict_enter=.t.
this.restrict_change=.f.
Script_Play("Edit Quote Hide / Show")
parentform:Text13.text="EDITING QUOTE"
parentform:Text13.refresh()
parentform:Button26.activate()
If From_QL="FROM" then
topparent.index_set("Quote_No")
topparent.find(Var->Curr_Quote_No)
parentform:Cust_Id.activate()
From_QL="NOTFROM"
Else
parent.resynch()
End If
Else
parentform:Text13.text="ENTERING NEW QUOTE"
parentform:Text13.refresh()
this.restrict_enter=.f.
this.restrict_change=.t.
Script_Play("New Quote Hide / Show")
parentform.new_record()
If Menu_Selector="NEW" then
Script_Play("Open Cust Manager")
Else
End if
End if
End
So if they enter the form to edit a record Menu_Selector variable would be 'EDIT'.
This all works and has done for a while except when I push a button to exit or save etc even a simple parent.commit() button and then it doesnt save changes.
The form itself has all the allow change/new etc ticked off.
Is this a simple mistake I have made in scripting or could something else have affected it - like maybe indexes or ???
Help would be appreciated as I am lost - it should be simple surely :)
Mike Lyon
Comment