This is a stupid question, but I haven’t found a good answer. I have been developing Access apps for a while. I never use recordsets and rarely use text fields. I directly use the fields from my table(s) in my forms. Why does this work when everyone else uses text fields and recordsets. I would appreciate any insight as I want to make my work better. Thanks!
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Recordsets and text boxes
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Recordsets and text boxes
- This topic has 6 replies, 4 voices, and was last updated 23 years, 10 months ago.
Viewing 1 reply threadAuthorReplies-
WSRupert
AskWoody Lounger -
WScharlotte
AskWoody LoungerMay 18, 2001 at 8:02 am #1783530Any time you’re working with a query or a bound form or even a table, you’re working with a recordset, so I assume what you mean is that you haven’t worked with recordsets created in code.
Recordsets are abstract objects and it might help if you remember that. They are NOT the table or the query or the data, but they REPRESENT a set of data that can be returned from a table or query (that’s simplistic, but for these purposes it’s adequate).
So you can create a temporary instance of a set of data by creating a recordset object, and you can then read, manipulate, and even change that data and have those changes written back to the tables themselves. In effect, this is what you’re doing when you use a bound form to edit a table, but it’s also possible to do it in code and without the form and its overhead. A recordset that doesn’t have to be displayed will work much faster than one that has to be loaded and then written to the screen.
One essential use of recordsets has already been mentioned–looping through them. What makes that particularly useful is that you can loop through them, examine each record, and do something depending on the value in the record or even just stop the whole process. A query has to go through every record in its recordset and it can’t be told “just stop if you find this condition”. There is also an upper limit to how complex a query can become before it blows up entirely, although you can accomplish even more highly complex actions using recordsets.
You can get very exotic with code-created recordsets, including nesting them so that you loop through every matching record in an orders recordset for each record in the customer recordset and do something appropriate. Try that with a query. So far, SQL doesn’t include the equivalent of For Each.
You can also pass them as objects, create collections of them to pass into other code routines, and write them out to text files. Using ADO, you can disconnect them from their connection, work with them, reconnect them and update the source. Again with ADO, you can “persist” recordsets, creating a virtual table that can be put on a diskette and handed to someone who can open and edit it using appropriate code, then give it back, and you can open it and use an updatebatch command to write all the changes back to the table.
There’s an analogy of sorts in the comparative strengths of macros and modules. Macros can do some fairly sophisticated stuff, but they lack the flexibility and control inherent in code. Queries can can do some pretty complex stuff, but they lack the flexibility and control provided by a code-created recordset. In both examples, you need to understand and learn to use the more complicated option in order to do serious development in Access.
-
WSShane Sargent
AskWoody LoungerMay 18, 2001 at 7:08 pm #1783548One other quick thought: it is my understanding that queries are saved in an optimized state, recordsets are not. So, in theory, a contest between a saved query and a recordset that performs exactly the same function but is created and executed in code will see the saved query emerge victorious in terms of time to execute.
Charlotte, folks at large, would you agree?
-
WScharlotte
AskWoody LoungerMay 19, 2001 at 5:05 am #1783592Apples and oranges! You can base a recordset on a saved query. Does that make the recordset optimized?
When you are doing updates that don’t require some complex evaluation of each record, it makes sense to use a query. When that isn’t possible, then the issue of “optimized” doesn’t arise.
-
-
-
ADH
GuestMay 18, 2001 at 5:01 pm #1783543Thanks for the replies. I do understand the concepts of recordsets, but have not had the discipline to figure out the coding. Will work on that! My other question on “text boxes” refers to creating an unbound text field on the form rather than putting the actual field on the form. That is, writing the value to the table in code. Any thoughts on why this is better?
-
WScharlotte
AskWoody LoungerMay 18, 2001 at 6:38 pm #1783547It isn’t better, it simply has different uses.
If you need to write multiple records from the same form page, it is necessary. For example, if you have a survey to fill in, each question and answer could/should be a separate record in a response table instead of a field in a flat table. In order to do that, you build the form with unbound controls and use code to write a record for each answer.
It is necessary where the underlying recordset is not updateable from a bound form. For example, if you wanted to base a form on a union query, the recordset would not be updateable, but you could use it to populate ubound controls and then use code to write the entire “record” back to the appropriate table. If you use ADO, you have no choice because forms bound to ADO recordsets are not updateable. In that case, you have to navigate through the recordset and populate the form and capture edits through code using an unbound form and unbound controls.
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Installing Feature Update Windows 11 24H2
by
geekdom
7 hours, 50 minutes ago -
Windows 11 Insider Preview build 27823 released to Canary
by
joep517
8 hours, 14 minutes ago -
Windows 11 Hotpatch
by
Hackmuss
3 hours, 5 minutes ago -
System Guard service error still won’t be fixed
by
Susan Bradley
8 hours, 52 minutes ago -
Operation ForumTroll: APT attack with Google Chrome zero-day exploit chain
by
Alex5723
3 hours, 4 minutes ago -
Troy Hunt of HaveIBeenPwned Phished
by
Lars220
4 minutes ago -
Microsoft Windows security auditing Code 5061
by
mpw
21 hours, 25 minutes ago -
Can’t display images in incoming Outlook 365 emails
by
WScopwriter
5 hours, 1 minute ago -
Windows 11 Insider Preview Build 26200.5510 early builds of 25H2
by
Alex5723
6 hours, 29 minutes ago -
0Patch : Micropatches released for SCF File NTLM Hash Disclosure Vulnerability
by
Alex5723
5 hours, 58 minutes ago -
Select multiple emails and they all open up!
by
CeeJay
1 day, 22 hours ago -
How to remove an update preview
by
Gunny
1 hour, 22 minutes ago -
Third party add ins reminder
by
Susan Bradley
1 day, 2 hours ago -
OTF, which backs Tor, Let’s Encrypt and more, sues to save its funding
by
Nibbled To Death By Ducks
1 day, 16 hours ago -
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
2 days, 2 hours ago -
How can I update “Explorer Patcher”
by
WSplanckster
2 days, 4 hours ago -
Check out the home page for Signal
by
CAS
2 days, 2 hours ago -
Windows 11 and Trial version of MS Office
by
Tex265
2 days, 1 hour ago -
Windows 11 Insider Preview build 26120.3585 (24H2) released to BETA
by
joep517
2 days, 9 hours ago -
Windows 11 Insider Preview build 26200.5510 released to DEV
by
joep517
2 days, 9 hours ago -
Windows 11 Insider Preview Build 26100.3624 (24H2) released to Release Preview
by
joep517
2 days, 9 hours ago -
Limits on User Names
by
CWBillow
2 days, 6 hours ago -
MS-DEFCON 4: Mixed bag for March
by
Susan Bradley
6 hours, 4 minutes ago -
Non Apple Keyboards
by
pmcjr6142
7 hours, 20 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
2 days, 4 hours ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
2 days, 1 hour ago -
Error updating to Win11 0x8024a205
by
bmeacham
1 hour, 23 minutes ago -
default apps
by
chasfinn
1 day, 9 hours ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
1 hour, 9 minutes ago -
Adding links to text in Word 2000
by
sgeneris
2 days, 8 hours ago
Recent blog posts
- System Guard service error still won’t be fixed
- Third party add ins reminder
- MS-DEFCON 4: Mixed bag for March
- Classic and Extended Control Panel — no need to say goodbye
- Things you can do in 2025 that you couldn’t do in 2024
- Revisiting Windows 11’s File Explorer
- Planning ahead for migration
- Woody Leonhard (1951–2025)
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.