Hi All
I have a clac field on a form to do a tablesum()
tablesum("cons","trunk_vehicle = 'var->vehicle1'" ,"wgt")
I have alltrim the var vehicle1 my result come back with 0
if i change vahicle1 for text 'ref123y' my result comes back with 1050
if the value of my vehicle1 is correct i can not understand why it does not come back with 1050
kind regards
Andy
ps here is the code where i set the vars
'Set c_layer = "G"
DIM C_Layer AS C
C_Layer = "G"
'query, bill_state = "G"
DIM records_found as N
records_found = topparent.queryrun("First_Trunk = \"g\"","","","No","",.f.)
'Refresh data in current form at parent level.
'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
topparent.Commit()
topparent.Resynch()
topparent.Refresh_Layout()
dim tbl as p
tbl = table.open("vehicles")
query.filter = "depot = 'G'"
query.order = ""
query.flags = ""
i_tbl = tbl.query_create()
dim recs as n
recs = i_tbl.records_get()
dim vars[recs] as c
tbl.fetch_first()
for i = 1 to recs
vars[i] = tbl.eval("vehicles")
tbl.fetch_next()
next
'Set 'Value' property of multiple objects in Form 'Oldallocate' .
topparent:Veh10.value = ""
topparent:Veh9.value = ""
topparent:Veh8.value = ""
topparent:Veh7.value = ""
topparent:Veh6.value = ""
topparent:Veh5.value = ""
topparent:Veh4.value = ""
topparent:Veh3.value = ""
topparent:Veh2.value = ""
topparent:Veh1.value = ""
if recs = 10 then
goto ten
else
if recs = 9 then
goto nine
end if
if recs = 8 then
goto eight
end if
if recs = 7 then
goto seven
end if
if recs = 6 then
goto six
end if
if recs = 5 then
goto five
end if
if recs = 4 then
goto four
end if
if recs = 3 then
goto three
end if
if recs = 2 then
goto two
end if
if recs = 1 then
goto one
end if
ten:
topparent:Veh10.value = alltrim(vars[10].vehicles)
nine:
topparent:Veh9.value = alltrim(vars[9].vehicles)
eight:
topparent:Veh8.value = alltrim(vars[8].vehicles)
seven:
topparent:Veh7.value = alltrim(vars[7].vehicles)
six:
topparent:Veh6.value = alltrim(vars[6].vehicles)
five:
topparent:Veh5.value = alltrim(vars[5].vehicles)
four:
topparent:Veh4.value = alltrim(vars[4].vehicles)
three:
topparent:Veh3.value = alltrim(vars[3].vehicles)
two:
topparent:Veh2.value = alltrim(vars[2].vehicles)
one:
topparent:Veh1.value = alltrim(vars[1].vehicles)
end if
dim vehicle1 as c
vehicle1 = alltrim(topparent:Veh1.value)
dim vehicle2 as c
vehicle2 = alltrim(topparent:Veh2.value)
end
I have a clac field on a form to do a tablesum()
tablesum("cons","trunk_vehicle = 'var->vehicle1'" ,"wgt")
I have alltrim the var vehicle1 my result come back with 0
if i change vahicle1 for text 'ref123y' my result comes back with 1050
if the value of my vehicle1 is correct i can not understand why it does not come back with 1050
kind regards
Andy
ps here is the code where i set the vars
'Set c_layer = "G"
DIM C_Layer AS C
C_Layer = "G"
'query, bill_state = "G"
DIM records_found as N
records_found = topparent.queryrun("First_Trunk = \"g\"","","","No","",.f.)
'Refresh data in current form at parent level.
'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
topparent.Commit()
topparent.Resynch()
topparent.Refresh_Layout()
dim tbl as p
tbl = table.open("vehicles")
query.filter = "depot = 'G'"
query.order = ""
query.flags = ""
i_tbl = tbl.query_create()
dim recs as n
recs = i_tbl.records_get()
dim vars[recs] as c
tbl.fetch_first()
for i = 1 to recs
vars[i] = tbl.eval("vehicles")
tbl.fetch_next()
next
'Set 'Value' property of multiple objects in Form 'Oldallocate' .
topparent:Veh10.value = ""
topparent:Veh9.value = ""
topparent:Veh8.value = ""
topparent:Veh7.value = ""
topparent:Veh6.value = ""
topparent:Veh5.value = ""
topparent:Veh4.value = ""
topparent:Veh3.value = ""
topparent:Veh2.value = ""
topparent:Veh1.value = ""
if recs = 10 then
goto ten
else
if recs = 9 then
goto nine
end if
if recs = 8 then
goto eight
end if
if recs = 7 then
goto seven
end if
if recs = 6 then
goto six
end if
if recs = 5 then
goto five
end if
if recs = 4 then
goto four
end if
if recs = 3 then
goto three
end if
if recs = 2 then
goto two
end if
if recs = 1 then
goto one
end if
ten:
topparent:Veh10.value = alltrim(vars[10].vehicles)
nine:
topparent:Veh9.value = alltrim(vars[9].vehicles)
eight:
topparent:Veh8.value = alltrim(vars[8].vehicles)
seven:
topparent:Veh7.value = alltrim(vars[7].vehicles)
six:
topparent:Veh6.value = alltrim(vars[6].vehicles)
five:
topparent:Veh5.value = alltrim(vars[5].vehicles)
four:
topparent:Veh4.value = alltrim(vars[4].vehicles)
three:
topparent:Veh3.value = alltrim(vars[3].vehicles)
two:
topparent:Veh2.value = alltrim(vars[2].vehicles)
one:
topparent:Veh1.value = alltrim(vars[1].vehicles)
end if
dim vehicle1 as c
vehicle1 = alltrim(topparent:Veh1.value)
dim vehicle2 as c
vehicle2 = alltrim(topparent:Veh2.value)
end
Comment