Please take a look at this code and see where I'm missing the boat. The code was copied in it's entirety for the AlphaSports, Invoice form, Zoom button. The names have been changed to protect the innocent. I also mad sure I had corresponding indices in the tables although I see no reference to them in the code. My code works well except for copying the FPI_Number which is in the first part of the code.
Thanks much,
kenn
This part is not code but for reference only.
AlphaSports------------------------------MINE
Invoice_Header--------Parent Table------F_Investigations
Invoice_Number--------Linking Field-----FPI_Number
Items-----------------Form--------------F_Timeline
Invoice_Items---------Child Table-------T_Timeline
CODE - The code in Italics is from AlphaSports for reference.
dim t as p
t = table.current()
dim count1 as n
'count1 stores the number of events for the current Browse before we zoom to the "f_Timeline" form.
'this will allow us to determine if the user added new events after returning from the Zoom.
count1 = t.eval("count(t_Timeline->FPI_Number,GRP->t_INVESTIGATIONS)")
'count1 = t.eval("count(Invoice_Items->Invoice_Number,GRP->INVOICE_HEADER)")
'set a global variable to store the FPI number
'then, when you create a new invoice item using the f_Timeline
'form, you will be able to fill in the FPI number that
'was inherited from the parent from.
DIM global varFPI_Number as C
varFPI_Number = t_INVESTIGATIONS->FPI_NUMBER
'DIM global varInvoice_Number as C
'varInvoice_Number = INVOICE_HEADER->INVOICE_NUMBER
'Zoom to form F_Timerline as a dialog box.
dim Shared varP_ZoomForm as P
'make sure that the browse has focus.
browse4.activate()
varP_ZoomForm = topparent.zoom_to_record("F_Timeline","dialog")
'browse1.activate()
'varP_ZoomForm = topparent.zoom_to_record("Items","dialog")
dim count2 as n
'now count the number of events.
count2 = t.eval("count(t_Timeline->FPI_NUMBER,GRP->T_INVESTIGATIONS)")
'count2 = t.eval("count(Invoice_Items->Invoice_Number,GRP->INVOICE_HEADER)")
'if the user added new events, fetch last event so that new event is visible.
if count2 > count1 then
browse4.Fetch_Last()
'if count2 > count1 then
' browse1.Fetch_Last()
end if
Thanks much,
kenn
This part is not code but for reference only.
AlphaSports------------------------------MINE
Invoice_Header--------Parent Table------F_Investigations
Invoice_Number--------Linking Field-----FPI_Number
Items-----------------Form--------------F_Timeline
Invoice_Items---------Child Table-------T_Timeline
CODE - The code in Italics is from AlphaSports for reference.
dim t as p
t = table.current()
dim count1 as n
'count1 stores the number of events for the current Browse before we zoom to the "f_Timeline" form.
'this will allow us to determine if the user added new events after returning from the Zoom.
count1 = t.eval("count(t_Timeline->FPI_Number,GRP->t_INVESTIGATIONS)")
'count1 = t.eval("count(Invoice_Items->Invoice_Number,GRP->INVOICE_HEADER)")
'set a global variable to store the FPI number
'then, when you create a new invoice item using the f_Timeline
'form, you will be able to fill in the FPI number that
'was inherited from the parent from.
DIM global varFPI_Number as C
varFPI_Number = t_INVESTIGATIONS->FPI_NUMBER
'DIM global varInvoice_Number as C
'varInvoice_Number = INVOICE_HEADER->INVOICE_NUMBER
'Zoom to form F_Timerline as a dialog box.
dim Shared varP_ZoomForm as P
'make sure that the browse has focus.
browse4.activate()
varP_ZoomForm = topparent.zoom_to_record("F_Timeline","dialog")
'browse1.activate()
'varP_ZoomForm = topparent.zoom_to_record("Items","dialog")
dim count2 as n
'now count the number of events.
count2 = t.eval("count(t_Timeline->FPI_NUMBER,GRP->T_INVESTIGATIONS)")
'count2 = t.eval("count(Invoice_Items->Invoice_Number,GRP->INVOICE_HEADER)")
'if the user added new events, fetch last event so that new event is visible.
if count2 > count1 then
browse4.Fetch_Last()
'if count2 > count1 then
' browse1.Fetch_Last()
end if
Comment