cardgunner
Registered User.
- Local time
- Today, 00:34
- Joined
- Aug 8, 2005
- Messages
- 210
I'm not experienced in code at all.
I can't figure out what is wrong with this code
Me.expiredate.Value = IIf([payterm] = "X", Forms![orderfrm]!orderdate, DateAdd([payterm], 1, Forms![orderfrm]!orderdate))
the whole thing is
I replaced the true/false parts with "01/01/2000", "02/02/2008" and it works fine.
using the dateadd code If I don't select a productid with a payterm as X it works great. But soon as I select a Productid whose payterm is X i get
Run-time error '5'
Invalid procedure call or arguement
I think it's telling me there is something wrong with my iif statement but I don't see it.
What am I missing or doin wrong?
I can't figure out what is wrong with this code
Me.expiredate.Value = IIf([payterm] = "X", Forms![orderfrm]!orderdate, DateAdd([payterm], 1, Forms![orderfrm]!orderdate))
the whole thing is
Code:
Private Sub cboproductid_AfterUpdate()
Me.txtamount.Value = DLookup("[amount]", "producttbl", "[productid] = Forms![orderfrm]!cboproductid") 'Populate the Item's Price.
Me.productname.Value = DLookup("[productname]", "producttbl", "[productid] = Forms![orderfrm]!cboproductid")
Me.updatepuchased.Value = IIf([payterm] = "X", "Yes", "No")
Me.expiredate.Value = IIf([payterm] = "X", Forms![orderfrm]!orderdate, DateAdd([payterm], 1, Forms![orderfrm]!orderdate))
End Sub
I replaced the true/false parts with "01/01/2000", "02/02/2008" and it works fine.
using the dateadd code If I don't select a productid with a payterm as X it works great. But soon as I select a Productid whose payterm is X i get
Run-time error '5'
Invalid procedure call or arguement
I think it's telling me there is something wrong with my iif statement but I don't see it.
What am I missing or doin wrong?