Runtime Error 13 Type Mismatch

CharlesWhiteman

Registered User.
Local time
Today, 05:26
Joined
Feb 26, 2007
Messages
421
Hi all, I'm using the following code and attempting to handle null but keep getting the afrementioned error??

Code:
Dim intAgentContactID As Integer
intAgentContactID = Nz(Forms!FrmPrimaryData.txtAgentContact.Column(0), "")
 
Code:
intAgentContactID = Nz(Forms!FrmPrimaryData.txtAgentContact.Column(0), [B][COLOR="Red"]0[/COLOR][/B])
 
Why don't you handle it when performing your calculation instead.
 
Thanks Drake, One question though wont that create an entry - as in enter a zero?

I'm basically wanting to say if a field is blank dont then ignore it.

I'm trying with the following (non-working as yet) code

Code:
If Not IsNull(Forms!FrmPrimaryData.txtEndUserContact) Then
Dim intEndUserContactID As Integer
intEndUserContactID = Forms!FrmPrimaryData.txtEndUserContact.Column(0)
Else
End If
 
So what is your issue? You have already trapped the Null value... What is your full code?
 
Maybe try this as it manages Null and ""

if len(field or variable & "") = 0 then

end if
 

Users who are viewing this thread

Back
Top Bottom