Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-10-2022, 05:43 PM
Guessed's Avatar
Guessed Guessed is offline Verify Textbox Data is on Array Windows 10 Verify Textbox Data is on Array Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I don't think AfterUpdate is the right trigger. Try using the trigger of leaving the text box instead.
Code:
Private Sub ObjectCode_Exit(ByVal Cancel As MSForms.ReturnBoolean)
  Dim sVals As String, sEntry As String
  sVals = "6119,6121,6129,6139,6141,6142,6413,6145,6146,6148,6149,6223,6237,6238,6239,6249,6256,6259,6267,6268,6269,6291,6293,6294,6299,6329,6339,6395,6399,6410,6411,6497,6499"
  sEntry = Me.ObjectCode.Value
  If Len(sEntry) <> 4 Or Not sVals Like "*" & sEntry & "*" Then
    MsgBox "Not a valid Object Code. Please verify and try again", vbOKOnly, "Invalid Input"
    Me.ObjectCode.Value = Null
    Cancel = True
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Verify Textbox Data is on Array textbox dependent on comboboxes data list Visor Word VBA 2 08-05-2019 05:19 AM
Data connection problem excel/sharepoint using an SUMIF array mwestra74 Excel Programming 10 11-28-2017 06:26 PM
Verify Textbox Data is on Array How do I make a checkbox or dropdown item reference data in that specific section of the data array? dhare Excel Programming 2 02-24-2016 12:36 PM
Verify Textbox Data is on Array Convert String Array to Integer Array from a User Input? tinfanide Excel Programming 4 12-26-2012 08:56 PM
How to count the frequency of data and also tally value from an array of Excel record KIM SOLIS Excel 5 09-07-2011 09:01 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft