473,413 Members | 2,066 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,413 software developers and data experts.

Access VBA Form - Find if Record Exists

risk32
98
I'm trying to do something that I'm not exactly sure how to go about. I know about queries and how to do those, but my form isn't set up for that particular purpose. Like a webpage that has a "Check Username Available" type of function for some, that's exactly what I want to do. All my form consists of right now is a text box, txtUsername, and a command button. My table is named Members with a record column named Username. Any help with this is appreciated.
Dec 5 '08 #1
4 29198
nico5038
3,080 Expert 2GB
Checkout the DLOOKUP() function. It will allow you to extract e.g. the password for the value entered in the txtUsername field.

Nic;o)
Dec 5 '08 #2
risk32
98
Nico,
I'm not exactly trying to extract a password so to speak. Basically, I just need to write an If statement to see if the value entered in txtUsername is in the column Username. It could just be that I need to develop a string search and search the records for that particular string.
Dec 8 '08 #3
missinglinq
3,532 Expert 2GB
Something like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub SearchUserNames_Click()
  2.  If Not IsNull(Me.txtUserName) Then
  3.   If DCount("UserName", "NameTable", "[UserName] = '" & Me.txtUserName & "'") > 0 Then
  4.     MsgBox "User Name Found!"
  5.   Else
  6.     MsgBox "User Name Not Found!"
  7.   End If
  8.  End If
  9. End Sub
Linq ;0)>
Dec 8 '08 #4
risk32
98
Thanks Linq,
This worked perfectly. All I had to do was tweak it slightly. I appreciate all you guys do for us, especially those still learning.

Adam
Dec 8 '08 #5

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

Similar topics

3
by: Randy | last post by:
I have been able to set up a Find Record Button on my switchboard to take me to a form with the correct case number by using a parameter query and macro. When I try to run the Find Record button...
4
by: Kaur | last post by:
I am reposting this message. I am a beginner using MS Access. I am working in MS Access 2000 and have created two forms. Form 1 is called frmParent (which has a read only subform called SfrmChild)....
7
by: gjoneshtfc | last post by:
Hello I want to search my database for a vehicle registration number but before i can search using the Find Record button i created i have to click in the registration field so that it is that...
2
by: liljet | last post by:
***From previous post*** Is it possible to have an Access form that displays in a text box the last modified date of c:\myworkbook.xls? try setting the data property of the text box to ... =...
1
by: crazdandconfusd | last post by:
I created a form based on one table and was able to find information using find record and searching entire form. Now I split the information into two tables: one for the front of a page to be...
4
by: Steven | last post by:
Hi, Would need some thought about using a button of the existing form to search record before deleting it. Any quick help is very appreciated. Steve
6
by: Helena666 | last post by:
Hi Its been a while since I have built a database using access and vba and am a bit rusty. I am using a command button on a form to write a record to a table, using an append query. However I need...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
1
Run2Eat
by: Run2Eat | last post by:
i feel like this is a doofus question... but i've created an access form and added a find record button, but when i use the form, the find record button searches the form itself, not the table. all...
7
by: kpresidente | last post by:
Hello all, I'm trying to transfer the value of a control on an Access form to an Excel worksheet using VBA. The Access form is a single form with all the controls disabled, so that data is "read...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.