Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Criteria mismatch
Richard Stein 
      
2 years ago
I am trying to look up a value and have it inserted into a text box with VBA on Form Load
Richard Stein OP  @Reply  
      
2 years ago

Richard Stein OP  @Reply  
      
2 years ago
I know the right value is being returned by the recordset to set the criteria. the answer to this look up should be "American Express".  I previosly tried it with Nz(DLookup("Category", "AccountCategories", "ACID = """ & RS.Fields(2) & """"), "Empty").  No matter I couldn't get the function to operate.

Thanks
Sami Shamma  @Reply  
             
2 years ago
Is your ACID numeric?
Richard Rost  @Reply  
          
2 years ago
Why are you using Fields(2) instead of the field name?
Richard Rost  @Reply  
          
2 years ago
I'd have to test this and I'm not at a computer right now, but I don't think you have access to the RecordsetClone collection when Form_Load runs. The recordset isn't fully loaded yet. What are you trying to do (in English)?
Richard Stein OP  @Reply  
      
2 years ago
Thanks for your help.  In my Account Profile table i use the ID for the Account category. When the form opens, I simply want to display the the Name of that Category instead of the number.  That is all.  Damn, that's it.  I'll just create a query that includes the field in the control source.  The control source is the table itself!!!

I do have the correct value in the recordset.clone.  When the program is in debug mode, when I hover over that rs field it dispalys the correct number '3"

Of course, when I run query on that ID, it shows the correct name for that category

The ACiD is the primary index for that record.
Richard Rost  @Reply  
          
2 years ago
You figured out the solution yourself. Just use a query to pull in the name. If you don't want to do that, you could use a DLookup in the control source of a text box, or even a locked combo box. You don't need anything to do with recordsets - or even VBA for that matter. You're trying to open a can of Coke with a jackhammer. :)

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/9/2026 2:39:02 PM. PLT: 1s