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.
5 3487 DeMan 1,806
Top Contributor
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.
ADezii 8,834
Recognized Expert Expert
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: - Private Sub txtNickName_AfterUpdate()
-
Me![txtNickName] = DLookup("[full name]", "nicknames", "[nickname]='" & Me![txtNickName] & "'")
-
End Sub
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.
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.
ADezii 8,834
Recognized Expert Expert
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.
- Private Sub txtNickName_AfterUpdate()
-
'See if a Full Name exists
-
If Len( Me![txtNickName] = DLookup("[full name]", "nicknames", "[nickname]='" & Me![txtNickName] & "'")) > 0 Then
-
Me![txtNickName] = DLookup("[full name]", "nicknames", "[nickname]='" & Me![txtNickName] & "'")
-
Else
-
'a Full Name doesn't exist
-
End If
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 DB2/UDB version 8.1 wrapper DRDA
authorization <INSTANCE_OWNER> password "<PASSWD>" options
(NODE 'LOCAL',DBNAME '<DBNAME>',FOLD_ID 'N',FOLD_PW 'N')
|
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 Solaris 8.1, with 64-bit
instances.
I have a NICKNAME called REMOTE_DW.T_MYTABLE which points to a
"union-all-view".
Several other nicknames exist to regular-tables and regular views in
|
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 it return the
associated records to a listbox. Once the listbox has the records, I
want to select a record, which will open a form associated with the
selected record in the listbox.
|
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(
Pk_myPrimaryKey INTEGER CONSTRAINT pk PRIMARY KEY DESCRIPTION 'This
is the primary key of the table',
|
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 7.0.9466,
.NET Framework 1.0.3705 and SQL Server 2000.
I have created a simple table in an SQL database. SQL server includes
ASPNET as a valid login which has unlimited access to all databases,
including the database I have created. The ASPNET...
| |
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,
|
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 same as the remote db name while tabname is
the same as the remote tabname.
|
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 researched solutions.
That said, I have a "training" database with PowerPoint briefings which I have users access and complete training. The form then records the date and time they completed training in a relevant field. I have a separate "master"...
|
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 have stepped through the code in debug and the connection string is correct up til the Fill command. Once the fill executes, the password disappears from the connection string. This particular Fill is performed to check that the user is valid for this...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |