Hello forum,
I have the following script attached to a OnChange event and it only sometimes produces the "Property Type Mismatch" error and I can't realiably produce the stopping of the error. The error occurs always on the first start of the form but sometimes stops and the script works properly. Also always works fine on V5 im running V4.5 266.
dim comp as p
comp=table.open("main")
comp.update_production_index()
ix=comp.index_primary_put("xselect")
nrec=ix.records_get()
comp.fetch_first()
xaxis.choice.list.redim(nrec)
yaxis.choice.list.redim(nrec)
for i=1 to nrec
xaxis.choice.list[i].text=comp.year
xaxis.choice.list[i].value=comp.year
yaxis.choice.list[i].text=comp.year
yaxis.choice.list[i].value=comp.year
comp.fetch_next()
next i
comp.close()
The error is produced by the line
xaxis.choice.list.redim(nrec).
This script is used on other forms and always works fine the only difference is the index which is used. In the case that doesn't work the index has a filter expression of REG=VAR->GROUP, with the VAR->GROUP being the field with the onchange event attached (when removed the scripts works but doesn't do it's job!). This is a problem produced when trying to get a form to do what I decscribed in a post from last week entitled "Changing listbox contents on the fly" which is what this script does in V5 but produces this error in V4.5
Any help or ideas on how to do this differently will be appreciated.
Thanks
Rich
I have the following script attached to a OnChange event and it only sometimes produces the "Property Type Mismatch" error and I can't realiably produce the stopping of the error. The error occurs always on the first start of the form but sometimes stops and the script works properly. Also always works fine on V5 im running V4.5 266.
dim comp as p
comp=table.open("main")
comp.update_production_index()
ix=comp.index_primary_put("xselect")
nrec=ix.records_get()
comp.fetch_first()
xaxis.choice.list.redim(nrec)
yaxis.choice.list.redim(nrec)
for i=1 to nrec
xaxis.choice.list[i].text=comp.year
xaxis.choice.list[i].value=comp.year
yaxis.choice.list[i].text=comp.year
yaxis.choice.list[i].value=comp.year
comp.fetch_next()
next i
comp.close()
The error is produced by the line
xaxis.choice.list.redim(nrec).
This script is used on other forms and always works fine the only difference is the index which is used. In the case that doesn't work the index has a filter expression of REG=VAR->GROUP, with the VAR->GROUP being the field with the onchange event attached (when removed the scripts works but doesn't do it's job!). This is a problem produced when trying to get a form to do what I decscribed in a post from last week entitled "Changing listbox contents on the fly" which is what this script does in V5 but produces this error in V4.5
Any help or ideas on how to do this differently will be appreciated.
Thanks
Rich
Comment