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

Enter nickname to fill in full name in Access database

I'm not a programmer. I have a table called nicknames with two fields--a nickname field and a full name field. I also have a Licensed Provider table with a full name field and some other info. I have a form to enter new licensed providers. I want to be able to enter the nickname in a field and then have it fill in the full name field. I've been looking for ways but everything I try gives me the message that there is no macro with that name, so I'm doing something wrong. Can anyone help with something simple? I'd like something I can put in the after update property. Thanks.
May 15 '07 #1
5 3462
DeMan
1,806 1GB
Hi CindySue,

Welcome to the scripts. This appears to be a question for the Access forum so I will move it to the appropriate place. While you will be able to access this thread still by clicking on the link, you will find a link to the Access forum in a drop-down list from the "Forums" tab on the blue bar at the top of your screen.
May 15 '07 #2
ADezii
8,834 Expert 8TB
I'm not a programmer. I have a table called nicknames with two fields--a nickname field and a full name field. I also have a Licensed Provider table with a full name field and some other info. I have a form to enter new licensed providers. I want to be able to enter the nickname in a field and then have it fill in the full name field. I've been looking for ways but everything I try gives me the message that there is no macro with that name, so I'm doing something wrong. Can anyone help with something simple? I'd like something I can put in the after update property. Thanks.
Assuming the Text Box you are entering the nickname in is called txtNickName, then to replace the nickname with the full name in the same Text Box, place this code in the AfterUpdate() Event of the Text Box:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtNickName_AfterUpdate()
  2.   Me![txtNickName] = DLookup("[full name]", "nicknames", "[nickname]='" & Me![txtNickName] & "'")
  3. End Sub
May 16 '07 #3
I'm sorry, but I can't get this to work. I copied the code, went to the After Event box and pasted, but that gives me the message it can't find the macro. I tried then selecting event procedure and pasting the code there, and it give me a message that says runtime error, you cancelled the previous operation.
May 16 '07 #4
I just got that to work. I think I had an s on nickname. Sometimes there won't be a nickname. Could I have the txtnickname box to enter a nickname if one existed (which I would know) and then it would put the full name in the full name text box? That way I could just skip the nickname box if I knew a nickname didn't exist and use a drop down to select the full name. I tried to change the names to the full name box, but not having much success. Thanks so very much for you help.
May 16 '07 #5
ADezii
8,834 Expert 8TB
I just got that to work. I think I had an s on nickname. Sometimes there won't be a nickname. Could I have the txtnickname box to enter a nickname if one existed (which I would know) and then it would put the full name in the full name text box? That way I could just skip the nickname box if I knew a nickname didn't exist and use a drop down to select the full name. I tried to change the names to the full name box, but not having much success. Thanks so very much for you help.
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtNickName_AfterUpdate()
  2. 'See if a Full Name exists
  3. If Len( Me![txtNickName] = DLookup("[full name]", "nicknames", "[nickname]='" & Me![txtNickName] & "'")) > 0 Then 
  4.   Me![txtNickName] = DLookup("[full name]", "nicknames", "[nickname]='" & Me![txtNickName] & "'")
  5. Else
  6.   'a Full Name doesn't exist
  7. End If
  8. End Sub
May 16 '07 #6

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

Similar topics

0
by: aj | last post by:
DB2 WSE LUW 8.1 Fixpak 5 Red Hat AS 2.1 I'm trying to set up a federated view from one DB2 database to another in the same instance on the same server. I do a: create server <SERVER> type...
6
by: _link98 | last post by:
Problem: getting SQL0181N for queries on nicknames to remote Union-All-View. Can't see what I'm doing wrong yet, maybe someone has seen this before. Environment: UDB ESE 8.1 + FIXPAK 9A, on...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
8
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
0
by: AndyAFCW | last post by:
I am developing my first .NET application that connects to a SQL Server 2000 database and I am having a total nightmare :x :evil: I am running Windows 2000 with Visual Studio .NET version...
5
by: Jiggaz | last post by:
Hi, Look my stored procedure : __________________ ALTER PROCEDURE dbo.CreateAccount @Nickname varchar(30), @Password varchar(15), @Email varchar(50), @Date datetime,
5
by: Asphalt Blazer | last post by:
OS: AIX 5L, DB2 UDB v8.2 the nicknames are created like this create nickname <schema-name>.<tab-name for <remote-db-name>.<remote-schema-name>.<remote-tabname> The schema name is usually...
5
by: Dakrat | last post by:
Allow me to preface this post by saying that this is my first database project, and while I have learned a lot, any concepts I have learned are hit and miss as I have found new requirements and...
1
by: dellis | last post by:
Problem: My project was initially created without putting passwords in the connection string. When I added the password in the connection string, it disappears when performing a database fill. I...
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: 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: 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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.