I have a database where if someone types in a number and that number already exist in the database I want code to search the table, find the that same number and show a message box saying that number already exists. Is this possible? I hope I'm making sense
It's very possible! It's called a parameterized query. You can pass the parameter to a select query in a couple of ways. One is to have the query pick up a value in a text box, combo box, etc or have the user type in the value when the query executes.
Another way to check if a vaslue is in your table is to set up your index as unique, with no duplicates. That is. when the user enters data for a new record, a msg will pop up warning the user that the value already exists and duplicates are not allowed.
The user is entering new data in unbound textboxes. The textbox I am validating is the "TagID" textbox. I have SQL code behind a Save button, and if the TagID matches what's in the table, I get a message saying the records cannot append.
The user is entering new data in unbound textboxes. The textbox I am validating is the "TagID" textbox. I have SQL code behind a Save button, and if the TagID matches what's in the table, I get a message saying the records cannot append.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.