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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Error 2471 on Defining a Variable
Martin Fairbairn 
    
11 months ago
Can anyone help me here". I am trying to create this varable:
Dim Rstart As String
    Rstart = DLookup("RangeStart", "acRanges", "RangeLetters = EQ")

"EQ" is just one test example of the data in the RangeLetters field

"RangeLetters" is a 2 letter short text primary key in table "acRanges" but I am getting this error " Run time error 2471.  The expression you entered as a query parameter produced this error 'EQ'
Kevin Robertson  @Reply  
          
11 months ago
Rstart = DLookup("RangeStart", "acRanges", "RangeLetters = ""EQ""")
Thomas Gonder  @Reply  
      
11 months ago
Martin Kevin got it right in your case. Here's a few more examples that may help in the future:
Rstart = DLookup("RangeStart", "acRanges", "RangeLetters = 99") 'if the ids are numbers, like autonumbers
Rstart = DLookup("RangeStart", "acRanges", "RangeLetters = """ & variableString & """)
Rstart = DLookup("RangeStart", "acRanges", "RangeLetters = " & variableNumber)
Rstart = DLookup("RangeStart", "acRanges", "RangeLetters = " & Str(variableNumber)) 'if might have a comma as the decimal
Martin Fairbairn OP  @Reply  
    
11 months ago
Thank you so much Kevin & Thomas.   Thomas, I tried your "variable string" version for my ultimate objective of DLookup("RangeStart", "acRanges", "RangeLetters = """ & [fkAccountType] & """) and got the error "The expression you entered has an invalid string".  Can you help me one more time?
Richard Rost  @Reply  
          
11 months ago
You've only got 3 """ at the end. You need 4 """". I know. It's confusing.
Richard Rost  @Reply  
          
11 months ago
Richard Rost  @Reply  
          
11 months ago
It's not your fault. The example that Thomas gave above is actually wrong. Naughty, naughty.
Richard Rost  @Reply  
          
11 months ago
I'm gonna leave it here long enough just to bust his balls... I'll fix it later. LOL
Martin Fairbairn OP  @Reply  
    
11 months ago
Thank you so much, Richard.  I now have a beautiful RangeStart and RangeEnd for my Chart of Accounts.  Please be nice to Thomas.  We need people like him :-)
Richard Rost  @Reply  
          
11 months ago
Martin I just kid with my long-time students and Access Veterans. He's a good guy. I kid cuz I love. :)
Thomas Gonder  @Reply  
      
11 months ago
Yea I screwed up. I actually make a lot of errors in my comments. I can't type or see very well in these little comment boxes that Richard gives us. Especially without an EDIT feature once we later see an error.

At least I can fix errors on my little laptop screen, after going nuts counting little quote lines or parenthesis in a procedure.
Thomas Gonder  @Reply  
      
11 months ago
"'''"'''" Can you tell how many single and double quotes I just typed? Aggghhh
On an old dumb terminal, which was mono-spaced, at least you had a chance.
Kevin Robertson  @Reply  
          
11 months ago
Thomas

1 Double Quote
3 Single Quotes
1 Double Quote
3 Single Quotes
1 Double Quote
Thomas Gonder  @Reply  
      
11 months ago
My dad wrote all his articles and books on an old Remington typewriter, except his last, in which he used an old DOS word processor, possibly named Word Pro if I remember correctly. I have no idea how the publishers of that day did the varying font sizes for an article. I suspect it was cut and paste by graphic artists of the day. If Richard lets the link remain, you may enjoy the articles (my dad's showing how someone proceeded Elon by 60 years in auto driving cars, p.55 of the mag). I get a kick out of the advertisements, many for the up-and-coming career of becoming a TV repairman.

https://www.worldradiohistory.com/Archive-Poptronics/50s/58/Pop-1958-05.pdf
Thomas Gonder  @Reply  
      
11 months ago

Thomas Gonder  @Reply  
      
11 months ago
Kevin You got a better screen or eyes than me. I don't remember what I typed, but I'll trust you.
Kevin Robertson  @Reply  
          
11 months ago
LOL. I copied it to Notepad. Made it easy to see them.
Richard Rost  @Reply  
          
11 months ago
Yeah, I've been meaning to build an edit feature, and it hasn't been a priority because it doesn't come up that often. I have an edit feature, so that's what really matters. LOL. It's just bulletproofing it so the average users can't mess with stuff. I don't feel like properly encoding everything to make it safe. For now, it's just the moderators and I who can edit stuff, but it'll come eventually when I get around to it.
Richard Rost  @Reply  
          
11 months ago

Thomas Gonder  @Reply  
      
11 months ago
My dad had a bunch of round pieces of wood made, about the size of a 50-cent piece back then, that just had the characters "2IT". He would hand them out to students or others that were late with something like homework.

I probably have a few in my "remembrance box" for missed Saturday morning chores. I think I got a can of sixty-year-old firecrackers from Hawaii in there still too. For $1 you got a big string of them, that we would use in Wrist Rocket slingshot wars around the old WWII bunkers on the North Shore of Oahu. I just passed on my original Wrist Rocket to my 10-year-old son. He'll have to wait a little longer for the stored away throwing knives and bull whip. (This was all long before the Indiana Jones films came out.) Colombia customs confiscated my collection of pellet guns when I moved here. A very sad day. They made such a scene out of them at the airport, something every USA boy had in the 1960s.

Richard, we need a way to add photos without resorting to a new post.
Thomas Gonder  @Reply  
      
11 months ago

Richard Rost  @Reply  
          
11 months ago
Yeah, that's on the list too. I'm a database guy, I'm not a web UI guy, so I do what I can when I can. I looked into making it so you could paste pictures directly into a text box, and that's a lot of work. One of these days I'll get around to it, lol.
Richard Rost  @Reply  
          
11 months ago
Speaking of the Round Two-It, did anybody have any of those Dilbert Mint tins? I used to have some.
Richard Rost  @Reply  
          
11 months ago

Richard Rost  @Reply  
          
11 months ago
And wait, you gave a wrist rocket to a 10-year-old?

Nice! :)
Richard Rost  @Reply  
          
11 months ago
Martin sorry we hijacked your thread. It happens sometimes.
Thomas Gonder  @Reply  
      
11 months ago
Richard That's about the age my dad let me buy one, with my own $ (about $5 which was damn expensive for the times), at Pep Boys after dinner at Joe's Cafe on State St in Santa Barbara. The next day, the neighborhood bully said I couldn't hit the "broad side of a barn", which I didn't understand the meaning of until it was explained with more laughs. A few minutes later I proved him wrong with a well-placed rock to his back side (which wasn't too broad) from twenty yards. And imagine, I didn't get sent to prison (or juvie) for it.

I never saw the Dilbert Mints. In some box, I've got the original Dilbert book of daily comics. A "friends" son stole my still sealed Playboy featuring Madonna, and the well-worn one I got from my dad of Marilyn. Now, that was pure evil!
Martin Fairbairn OP  @Reply  
    
11 months ago
I am honoured to have stimulated such an exchange :-)
Kevin Robertson  @Reply  
          
11 months ago
Martin Here are some videos which may help you with errors in the future.

Error Messages
Error Handling
Trap Form Errors
Martin Fairbairn OP  @Reply  
    
11 months ago
Thank you.  I'm struggling to wade through the tutorials.  I'm currently on Expert 6!  it's truly amazing how important learning the little tweaks at the lower levels is.  I though I was was advanced but I learn something in almost every lesson
Richard Rost  @Reply  
          
11 months ago
I should start a whole page filled with comments from users who said that. One of the things people always want to do is skip the beginner levels, and I'm like no, you really shouldn't. It's not because I'm trying to sell more lessons (the beginner levels are priced really cheaply), but because they're filled with little nuggets of wisdom that you really need to have later on.

That's one of the reasons I don't open my forums up to everybody. I want this to be a discussion with people who have learned how to use Access from me and do it my way. I look at forums online, and you get all these other people with all these different ideas and ways of doing things. Experts think they know what they're doing, answering questions, and I'm like, no dude, that's not how that works. That's why this is a closed ecosystem.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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: 4/30/2026 8:47:23 AM. PLT: 2s