AJParkinson
Technical User
This is driving me crazy.
Basically - I have a checkbox on a form that when ticked opens a second form. Various functions are performed and values are written to this form and into variables. From this form the variables are passed back and used to populate additonal fields on the first form...
All except on field/variable! This field is a sum field on the second form. The value of this field is written to the variable and passed back as with the others, however when reading this variable back into a field on the first form I get a type mismatch error, and the code halts - (the variable is not populated) - if I reset the next statement line back 2 lines to re-read the second form field value, then continue to run the code, everything works.
If I put a breakpoint in just before it initally reads the field and F8 through it, it works fine - take the breakpoint back out and it errors again! It appears to be a timing issue -
Any ideas greatly appreciated...
Andrew
Basically - I have a checkbox on a form that when ticked opens a second form. Various functions are performed and values are written to this form and into variables. From this form the variables are passed back and used to populate additonal fields on the first form...
All except on field/variable! This field is a sum field on the second form. The value of this field is written to the variable and passed back as with the others, however when reading this variable back into a field on the first form I get a type mismatch error, and the code halts - (the variable is not populated) - if I reset the next statement line back 2 lines to re-read the second form field value, then continue to run the code, everything works.
If I put a breakpoint in just before it initally reads the field and F8 through it, it works fine - take the breakpoint back out and it errors again! It appears to be a timing issue -
Code:
PFterritory = Trim(Forms!pf_contrib_sub.Form!territory.text)
Forms!pf_contrib_sub.Form!order_qty.SetFocus
PFQty = Trim(Forms!pf_contrib_sub.Form!order_qty.text)
Forms!pf_contrib_sub.Form!product.SetFocus
PFpassy = Trim(Forms!pf_contrib_sub.Form!product.text)
Forms!pf_contrib_sub.txtSumVal.SetFocus
[COLOR=red]PFOSum = Forms!pf_contrib_sub.txtSumVal.text[/color] [COLOR=green]'code breaks at this point[/color]
GetPFBase
GetPFSize
GetPFBand
Any ideas greatly appreciated...
Andrew