473,289 Members | 2,141 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,289 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 2439
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.