473,388 Members | 1,552 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to validate Textbox Value using Table Values?

Good Morning,

I would like to validate a value entered in a textbox to make sure it matches one of the values in a table. The approach I took is a dlookup, but I can only get it to work for one of the values (the first one)

Here is my code

Expand|Select|Wrap|Line Numbers
  1. If Me.AFOs.Value <> DLookup("AFO", "AFO_LOOKUP", "Office = '" & Me.Approver_Office.Value & "'") Then Me.AFOs.enabled = True And MsgBox("AFO(s)Invalid. Please enter valid AFO and format AFO,AFO for single Service Center and format with a space between AFOs for multiple Service Centers (AFO, AFO)")
I am guessing my criteria is bad or the table design is bad. My table is below. I would like to make sure the value in the textbox AFOs matches one of the values in the AFO column when I submit my form.

Office AFO
NASHVILLE 101
NASHVILLE 101, 259
NASHVILLE 101,259
NASHVILLE 101259
NASHVILLE 259
NASHVILLE 259101

I would greatly appreciate any help! Thank you!
Nov 30 '10 #1
1 2450
Hey guys, I am still stuck on this...I would appreciate any help. If you need more detail let me know.
Dec 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: H Branyan | last post by:
I need to format a textbox value a user enters. The user will enter 13 characters, and then I have to format them, preferably in the onBlur event, to look like this: XXXX-XX-XXX-XXXX I found...
0
by: Mark | last post by:
All, Excuse the re-post but I have found something which works for the UserID but not for the Password (see previous post below). The problem is I don't understand how it works and therefore...
0
by: Nithin | last post by:
My code as an txt attachment. I have 2 drop down list boxes that on selection populate text boxes from my database table. I am able to display the correct values in these text boxes. I have 2...
0
by: bigmaddaz | last post by:
Right I have a table on a page containing a recordset showing various records, when they click add button it add the information from that table into another one successfully. But now on that table...
1
by: sivagururaja | last post by:
Hi All, Im using ASP.NET with C#. (.NET 2005) In my page i want to allow the user to search the text from the SQL table. This is my table ID Name City State 1 Parry ...
1
by: sathyan8294 | last post by:
i am using dotnet 2003.i am doing my project in vb.net windows application.i have two form in my project.first form is datagrid .In second form label,textboxes and combobox are avilable to save the...
1
by: yegeswari | last post by:
Hi, How to validate given textbox value is number only. Suppose given text value is other than number mean it should give an alert message. Thanks and regards, Yegeswari
4
by: billa856 | last post by:
Hi, I want to know how can we set the value of Textbox = value of field in table when we select a value form combobx. example i have a table customer CID CNAME CSALARY 1 Billa ...
2
by: Archanak | last post by:
Hi, I have one common text box to get email id. I have 2 forms and both form action connects to different programs. I want to use this textbox value(i.e email id) only for both the forms. How...
5
by: temijojo | last post by:
Hello, Can someone help me in this problem. In my content page, I used 2 user controls inside an Ajax Toolkit TabControl. One of the user controls is a data entry with a dropdownlist. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.