jeran042
Registered User.
- Local time
- Today, 01:04
- Joined
- Jun 26, 2017
- Messages
- 127
Good morning all,
I have 4 unbound controls on a subform. The first control tests and strips away unwanted leading characters:
Name: txtADJ_POLICY
Name: txtTEMP_DESC
The second does a lookup to a table based on the field [POLICY]
Name: txtINVOICE_NOTES
And the third does a lookup on a linked table. It removes the carriage returns from within the [NOTES] field (This table is the reason why the [POLICY] number needs to be formatted:
And all 3 of these fields work correctly. Each pulling (or formatting) the piece of information I need.
My question is this, in the 4th unbound textbox I concatenate txtTEMP_DESC and txtINVOICE_NOTES with a line break:
And my problem is this, most time this works correctly. Combining the 2 fields, with a line break. However on some records, the fields txtTEMP_DESC and txtINVOICE_NOTES will return the correct answer, but the field txtINVOICE_NOTES gives a "#Size!" error? I should note the formulas for each of these unbound controls is in the Control Source of the control. And none of these fields are formatted (by the format property of the control) as anything.
And suggestions on what may be causing this?
Very much appreciated,
PS: I realize that this is definitely not the best way to go about this, but in this instance (if I can get this to work correctly), I would accept it
I have 4 unbound controls on a subform. The first control tests and strips away unwanted leading characters:
Name: txtADJ_POLICY
Code:
=Nz(IIf(Left([POLICY],1)="R",Mid([POLICY],3,Len([POLICY])),IIf(Left([POLICY],1)=0,Mid([POLICY],2,Len([POLICY])),[POLICY])),"")
Name: txtTEMP_DESC
The second does a lookup to a table based on the field [POLICY]
Code:
=Nz(DLookUp("DESCRIPTION","TBL_TEMP_MONTH_TO_DATE","[VOUCHER_NUMBER]= '" & [POLICY] & "'"),"")
Name: txtINVOICE_NOTES
And the third does a lookup on a linked table. It removes the carriage returns from within the [NOTES] field (This table is the reason why the [POLICY] number needs to be formatted:
Code:
=Replace(Nz(DLookUp("NOTES","tblInvoiceLog","[VOUCHER_NUMBER]= " & [txtADJ_POLICY] & ""),""),Chr(13) & Chr(10)," ")
And all 3 of these fields work correctly. Each pulling (or formatting) the piece of information I need.
My question is this, in the 4th unbound textbox I concatenate txtTEMP_DESC and txtINVOICE_NOTES with a line break:
Code:
=Trim(Nz([txtTEMP_DESC])) & Chr(13) & Chr(10) & Trim(Nz([txtINVOICE_NOTES]))
And my problem is this, most time this works correctly. Combining the 2 fields, with a line break. However on some records, the fields txtTEMP_DESC and txtINVOICE_NOTES will return the correct answer, but the field txtINVOICE_NOTES gives a "#Size!" error? I should note the formulas for each of these unbound controls is in the Control Source of the control. And none of these fields are formatted (by the format property of the control) as anything.
And suggestions on what may be causing this?
Very much appreciated,
PS: I realize that this is definitely not the best way to go about this, but in this instance (if I can get this to work correctly), I would accept it
Last edited: