Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Developers    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
DoCmd with Text Value DLookup
Ronald de Boer 
      
2 years ago
Hi,

I asked ChatGPT for the syntax and this below is what it gave me:

    DoCmd.OpenForm "HelpF", , , "HelpID = DLookup(""TaskID"", ""FormNameIDF"", ""TaskFormId = '" & Me.Caption & "' "")"

When I run this code MS Access returns a 3078 error.  Any ideas? I wiill attach a screenshot of the table.

Thx

Ronald de Boer OP  @Reply  
      
2 years ago

Ronald de Boer OP  @Reply  
      
2 years ago

Ronald de Boer OP  @Reply  
      
2 years ago

Ronald de Boer OP  @Reply  
      
2 years ago

Kevin Robertson  @Reply  
          
2 years ago
It looks like you are referring to the Form instead of the Table in your DLookup function.
Is the caption in the Button (as per your second image)? Your code is looking at the caption of the Form.

I would perform the DLookup first and store that value in a variable, then use the value of the variable in the Where condition of the DoCmd.OpenForm.
Ronald de Boer OP  @Reply  
      
2 years ago
Thank you John,  As Richard says time and time again 98% of the time it is a spelling mistake  and yes I was thinking forms and put the F at the end of the Table name instead of T for table.
Ronald de Boer OP  @Reply  
      
2 years ago
Hi Kevin sorry giving thanls to John when I should have said thanks to you.  Thanks!

Ron dB

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

Next Unseen

 
 
What's This?

 

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: 9/6/2026 5:15:29 AM. PLT: 0s