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

best way to retreive data from table to form

Hi guys,

I have a form that is checking staff names against staff numbers and I'm looking for the best way to return this data.

I have up to 20 text boxes where staff numbers are entered, and 20 text boxes next to those where I would like the staff names filled it.

I originally had some great advise on a Dlookup, which worked fine for one search at a time but looking for multiple staff numbers against a list of 1300 takes a very long time. I have a feeling from what I've read that using a query would work faster. I've never tried to integrate queries and forms so I'm feeling out of my depth.

My ideal solution would be to have the seperate text boxes, the user fills in as many as required and then a "search" Cmd button checks the staff number against the table and brings back the person's name.

Thanks very much in advance for any help you can provide.

If I can provide any more information I will.
Nov 10 '11 #1
6 1766
dsatino
393 256MB
For starters, 1300 records is nothing for a database engine so dlookup should be fine, even for 20 fields. If it seems slow, then you probably lack an index on the table that has the employee numbers.
Nov 10 '11 #2
Thanks for your reply.

What do I need to do to get round this then?

Thanks again.
Nov 11 '11 #3
Mihail
759 512MB
I suspect a poor design of your database.
Why 20 text boxes with the same type of data ?
Have you 20 tables (or 20 fields) on the same table (one for each staff number) ?
The same question for the staff names.
Nov 11 '11 #4
NeoPa
32,556 Expert Mod 16PB
Your understanding seems about right to me ScrapCode.

I would consider updating the values in the staff name TextBoxes in the AfterUpdate event procedure of the various staff number TextBoxes. The code to do that should be as common as possible of course. have a separate procedure which takes the staff number as a parameter and returns the staff name which is called from within all the different AfterUpdate event procedures.
Nov 12 '11 #5
Thanks NeoPa. That was the way I first approached it. However the user will be manually entering a up to 20 staff numbers. The idea behind bringing the name back is to give the user a visual check that they have not made a mistake with the number. If I use the after update then won't the last box not be checked until after the user has hit submit?

Even using the Dlookup on one search at a time does take around 10 seconds. The table it's looking through doesn't have a primary key, I assume that this is the indexing problem I was advised of. I'll go and see if changing that will speed up the search.
Nov 14 '11 #6
NeoPa
32,556 Expert Mod 16PB
ScrapCode:
If I use the after update then won't the last box not be checked until after the user has hit submit?
I think you may be confusing the control's _AfterUpdate() procedure with the form's Form_AfterUpdate() one. No. That shouldn't be a problem.

ScrapCode:
The table it's looking through doesn't have a primary key, I assume that this is the indexing problem I was advised of.
Absolutely. A small (generally integral) PK is required as well as, if they are on different fields, an index for the field you are using to select by. The size of the PK data effects the speed of all other index lookups too.
Nov 14 '11 #7

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

Similar topics

2
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5...
4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
1
by: Alex.Wisnoski | last post by:
I have a data entry form with a combo box to look up an entrant's name. If the name is already in the table then it pulls up the record and that part of the form works fine. If the name isn't in...
1
by: Christian H | last post by:
Hi! I think I remember somewhere that using request.form was a bad idea (I can't say I remember why). So I'm wondering: What is the best way to retrieve form values? Is request.form the best...
5
by: Aspnot | last post by:
Background: I have a data entry form that is bound to a DataSet. This DataSet contains 9 tables and the form displays data from each table in textboxes, not a DataGrid. One of the tables in the...
2
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the...
17
by: Timothy.Rybak | last post by:
Hello all, This is my first attempt at an application, so kid gloves are appreciated. I need to make a very simple form that only has a few elements. One is TraceCode - a text field that is...
1
by: Richard | last post by:
Very typical normal data Table One ------ One.OneID (PK) One.Name One.Description One.TwoID (FK) One.ThreeID (FK) ....
13
by: G | last post by:
Hello, Looking for opinions on a fairly simple task, new to ASP.net (C#) and want to make sure I do this as efficiently as possible. I have a web based form, and I need to run some SQL before...
0
by: goldxr | last post by:
Hi, I'm new to MS Access and currently using the 2003 version. I have had very little VBA coding experience and need to set up a database which will enable to track staffing needs as projects...
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
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...
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.