473,830 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Autopopulating fields in a form, MS Access 2000

I have a table of about 6000 clients which have unique client numbers.
I am creating a data entry form to log contacts with the clients. I
want the client information (Name, Sales Rep, phone number, etc) to
autopopulate fields on the form when the client number is entered. I
have seen this done on another database I have access to, but have
been unseccessfull in recreating it. Can anyone point me in the right
direction?

Apr 15 '07 #1
5 3261
you want to use Dlookup in an event procedure that runs after you update the
client number

"lvroye" <rp*********@co x.netwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.com.. .
>I have a table of about 6000 clients which have unique client numbers.
I am creating a data entry form to log contacts with the clients. I
want the client information (Name, Sales Rep, phone number, etc) to
autopopulate fields on the form when the client number is entered. I
have seen this done on another database I have access to, but have
been unseccessfull in recreating it. Can anyone point me in the right
direction?

Apr 15 '07 #2
Hi Ivroye

I would not be keen to do a dlookup after the even. For a start, you
only get 1 value back at a time, which may make for slow processing
when you have to get a lot of data back.

Try something like this
Client Number <after update>

dim db as dao.database
set db = currentdb()
dim rst as dao.recordset

set rst = db.openrecordse t("select * from tblClientInfo where
clientnum = " & cstr(me!tboClie ntNum, dbopensnapshot)

if rst.recordcount 0 then
me!tboclientnam e = rst!clientfirst name & " " & rst!clientfamil yname
me!tboaddress= rst!clientstree t & " " & rst!clientcity
me!tbophone= rst!clientareac ode & " " & rst!clientmainp hone
endif

On Apr 16, 8:56 am, "lvroye" <rpelling...@co x.netwrote:
I have a table of about 6000 clients which have unique client numbers.
I am creating a data entry form to log contacts with the clients. I
want the client information (Name, Sales Rep, phone number, etc) to
autopopulate fields on the form when the client number is entered. I
have seen this done on another database I have access to, but have
been unseccessfull in recreating it. Can anyone point me in the right
direction?

Apr 16 '07 #3

"lvroye" <rp*********@co x.netschreef in bericht news:11******** **************@ y80g2000hsf.goo glegroups.com.. .
>I have a table of about 6000 clients which have unique client numbers.
I am creating a data entry form to log contacts with the clients. I
want the client information (Name, Sales Rep, phone number, etc) to
autopopulate fields on the form when the client number is entered. I
have seen this done on another database I have access to, but have
been unseccessfull in recreating it. Can anyone point me in the right
direction?
Use a query that auto-magically poputlates your fiellds from the Client table.
Check 'AutoLookup-query' in Help

Arno R
Apr 16 '07 #4
"lvroye" <rp*********@co x.netwrote
I have a table of about 6000 clients which have unique client numbers.
I am creating a data entry form to log contacts with the clients. I
want the client information (Name, Sales Rep, phone number, etc) to
autopopulate fields on the form when the client number is entered. I
have seen this done on another database I have access to, but have
been unseccessfull in recreating it. Can anyone point me in the right
direction?
Consider using a Subform Control linked to the Client ID in the main Form's
Record Source (or if the response isn't satisfactory, with code to create a
RecordSource for the Form embedded in the Subform Control that just returns
the one record). Then it will automatically populate when you move to or
select a new Client.

You can design/format the forms so that it is not obvious that it is a
Subform, if you wish.

Larry Linson
Microsoft Access MVP
Apr 16 '07 #5
I'm going to go a different route, and you tell me if this is what you
need.

Often, when a client requests this functionality, the only thing that
they really want to see is the data. They do not want the data saved,
and they do not want the ability to modify it. Rather, they want to
type in a customer number, and have the first/last names, phone
numbers, etc. populate to ensure that it is the correct customer.

If this is what you are looking for, then you could have a drop down
list box (combo box) that has something along the following for the
row source:

Select ClientID, CLientName, SalesRep, PhoneNumber, (etc.) from
Clients

Now, you can set the ColumnCount in the properties to the correct
number of fields returned. In the ColumnWidth property, set the
fields to be 0 for those that are not displayed. Something like: 1";
0;0;0;0;0;0

Now, you can create a text box, and for it's ControlSource, set it to:

Forms!FormName! ComboBoxName.Co lumn(1) (keep in mind it's 0 based, so
Column(1) is the second column)

Whenever you change the combo box, it will change the name as well.
6000 records shouldn't be too many, if you are pulling from a local
database. If it's coming from SQL Server, then network traffic will
impact your combo box.

Chris Nebinger

On Apr 16, 8:03 am, "Larry Linson" <boun...@localh ost.notwrote:
"lvroye" <rpelling...@co x.netwrote
I have a table of about 6000 clients which have unique client numbers.
I am creating a data entry form to log contacts with the clients. I
want the client information (Name, Sales Rep, phone number, etc) to
autopopulate fields on the form when the client number is entered. I
have seen this done on another database I have access to, but have
been unseccessfull in recreating it. Can anyone point me in the right
direction?

Consider using a Subform Control linked to the Client ID in the main Form's
Record Source (or if the response isn't satisfactory, with code to create a
RecordSource for the Form embedded in the Subform Control that just returns
the one record). Then it will automatically populate when you move to or
select a new Client.

You can design/format the forms so that it is not obvious that it is a
Subform, if you wish.

Larry Linson
Microsoft Access MVP

Apr 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
19190
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
3
10249
by: Yan Roosens | last post by:
Hello all, I'm a total newbie with SQL Server 2000 and I have a little problem when moving a database form Access 2000 to SQL Server 2000. In the Access database, each table has an auto-increment field. After importing the tables in SQL Server, all the auto-increment fields are turned into "int" type fields. Does anybody have an explanation for that mystery? Thanks in advance,
1
6170
by: Serious_Practitioner | last post by:
Hello, all - I want to get a customer name, address and so forth from a customer table using either a SELECT statement in a VBA procedure or in a query. The user should be able to put a customer number in a text box and I'd like the information to pop up in text boxes on a form. Is it possible to bind text boxes to, say, the fields containing the CustName and CustAddress in a query? I want to use text boxes for appearance; I don't...
3
3719
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what a spreadsheet might show, the column names will actually be dynamic, based on data from a SQL Server 2000 database. The row data will also come from the same database. So in this case, I will have a main report and a subreport. I've already tried...
1
2975
by: tconway | last post by:
I have an Access program that displays Customer data into a form and OrderID data into a subform. The totals in the Subform are based on calculated fields, i.e. the Total Amount field Calculates the following: =* The Subform Order fields are pulled from a Query along with each calculated Total. They are displyed in a DataSheet View. This works fine on my developement environment which includes a server set up just as our client has. ...
2
1922
by: Darryl Kerkeslager | last post by:
As the subject above hopefully makes clear, I want to do several reports, "with lots of fields not otherwise in database". These reports also have variable-length text. I have defined the following options (all users have Office 2000): 1. All Access solution. This appears to involve creating forms to enter data that is just put into a report, and never saved - an exercise in wasted development time, to my thinking. Also, the...
6
2819
by: Mark | last post by:
Hello. I have an MS Access 2000 form whose fields I need to read and write from VBA. The fields are data-bound, using a query that has been defined and saved in my Access database. The query uses local data only (no external references.) This worked fine until I added some additional fields to the recordset. The new fields do not show up in the object browser, and I get an error if I try to use them. This problem occurs whether
2
3364
by: seltzer | last post by:
I am using Access 2000 but I also have the 2003 version. I am working on creating a data entry form in Access for a research study. Since there is a maximum of 255 fields per table in Access, I have to split the fields up (unfortunately). I am creating a form for each section and all of the respective fields, and then I am putting all these forms into one larger form as subforms. I have a few questions & am hoping someone has answers: ...
28
2428
by: CatrionnaRain | last post by:
Hi All - I'm using 2002 and consider myself an intermediate Access user but newbie programmer :) I've been tasked with the db project from hell and have been combing through posts for the last week looking for relevant snippets. The problem is that my problem is multi-tiered and although I've seen hints I haven't yet come across anything like this problem. So - without further ado here's the situation. I've got a db that has 3 tables. ...
0
9642
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,...
0
10770
Oralloy
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...
0
10481
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10524
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,...
0
9312
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, 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...
0
5616
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...
0
5779
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4409
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
2
3956
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.