Check value in combobox

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Check value in combobox

Post by sal21 »

I need to check if user insert correct value in combobox...

i have this code but not work corect!

If Not Left$(Me.MATR_CERCA.Text, 2) = "AB" And Not IsNumeric(Right$(Me.MATR_CERCA.Text, 5)) Then

only admitted value contain prefix "AB" + nnnnn (nnnnn is only a numeric value)

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Check value in combobox

Post by HansV »

Instead of And, use Or.
Best wishes,
Hans