How To: Trap Access error message.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi TWIMC,

I have combo box on a form and if the user deletes the selected entry from
the combo so it is blank or holding a null value, when the user move of the
record e.g. to save the record I get the message 'You tried to assign the
Null value to a variable that is not a Variant data type." how do I trap this
event so I can put my own message, e.g. one that my user will understand. I
presume it passes the 'Not in List' event because it a part of the form
trying to save the record, I just need to know what event is triggered.


TIA
KM
 
Hey Kevin,

Try this:
If Trim(Nz(Me.[cboBoxName],"")) = "" Then
'Your message here
End If

HTH,
Shane
 
Thanks,

but within which event procedure?

TIA
KM

shanesullaway via AccessMonster.com said:
Hey Kevin,

Try this:
If Trim(Nz(Me.[cboBoxName],"")) = "" Then
'Your message here
End If

HTH,
Shane

Kevin said:
Hi TWIMC,

I have combo box on a form and if the user deletes the selected entry from
the combo so it is blank or holding a null value, when the user move of the
record e.g. to save the record I get the message 'You tried to assign the
Null value to a variable that is not a Variant data type." how do I trap this
event so I can put my own message, e.g. one that my user will understand. I
presume it passes the 'Not in List' event because it a part of the form
trying to save the record, I just need to know what event is triggered.

TIA
KM
 
Back
Top