brucemc777
Member
- Local time
- Yesterday, 19:02
- Joined
- Nov 1, 2012
- Messages
- 88
I have the following assignment in VBA though the Assignment itself probably doesn't matter (GECo is a declared variable. Trying to assign it the value in the textbox GrossEquipmentCost when that value exists) :
The issue is that when the textbox for GrossEquipmentCost is totally empty i get the following error:
And so in wishing to avoid this error i try to test for it. If i try
i get False.
If i try
i get False.
If i try nz(GECo = Forms!frmOrderCreate!frmOrderAddEquip.Form.GrossEquipmentCost)
I get
If (in the Immediate window) i try
I get
Same as above for "= vbNullString".
So if it isn't an error but it is Errors 2427, -2147352567 (80020009) and 438, what is it and how do i test for it in order to avoid it?
I think i'm confused.
Much appreciate the advantage of learning from your knowledge,
-Bruce
P.S. And by the way, i have no idea as to when or why to use ".Form." near the end after all the forms have been stipulated in the "FORMS!" statement, but i find sometimes when i stick it in it stops an error from occurring and other times i have to omit it...
Code:
GECo = Forms!frmOrderCreate!frmOrderAddEquip.Form.GrossEquipmentCost
The issue is that when the textbox for GrossEquipmentCost is totally empty i get the following error:
And so in wishing to avoid this error i try to test for it. If i try
Code:
IsError(GECo = Forms!frmOrderCreate!frmOrderAddEquip.Form.GrossEquipmentCost)
If i try
Code:
IsNull(GECo = Forms!frmOrderCreate!frmOrderAddEquip.Form.GrossEquipmentCost)
If i try nz(GECo = Forms!frmOrderCreate!frmOrderAddEquip.Form.GrossEquipmentCost)
I get
If (in the Immediate window) i try
Code:
? Forms!frmOrderCreate!frmOrderAddEquip.GrossEquipmentCost = ""
I get
Same as above for "= vbNullString".
So if it isn't an error but it is Errors 2427, -2147352567 (80020009) and 438, what is it and how do i test for it in order to avoid it?
I think i'm confused.
Much appreciate the advantage of learning from your knowledge,
-Bruce
P.S. And by the way, i have no idea as to when or why to use ".Form." near the end after all the forms have been stipulated in the "FORMS!" statement, but i find sometimes when i stick it in it stops an error from occurring and other times i have to omit it...