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 
StateCombo Not Recognized
Chuck corvec 
    
41 days ago
I am having trouble with this little piece of code. In one of your videos you demonstrated how to make a dropdown list appear when the field has got focus. see my code below

Private Sub ProvID_GotFocus()

    statecombo.Dropdown

End Sub

Note the lack of capitalization in 'statecombo' It is as if access  does not recognize it as a calid statement

It should look like this StateCombo.Dropdown based on your video.
I have searched high and wide and can not find an answer

I am using Microsoft 365 Apps for Business
Alex Hedley  @Reply  
           
41 days ago
What's the name of the control?
Chuck corvec OP  @Reply  
    
41 days ago
Had to sign up before I could reply. The control name in this instance is ProvID

However it is doing it with all of them. It's like access does not understand the statecombo part of the statement

When I click on the control I get Runtime error 424 Object required
Kevin Robertson  @Reply  
          
41 days ago
Access is not recognising StateCombo because the Combo Box is named ProvID.
Chuck corvec OP  @Reply  
    
41 days ago
Can you elaborate on that
Chuck corvec OP  @Reply  
    
41 days ago
What should it be named
Richard Rost  @Reply  
           
41 days ago
Okay, which video are we talking about here? I use StateCombo in a lot of different videos. What Kevin is trying to say is that if you name the combo box itself "ProvID," then Access will not know what state combo is. It has to be the same thing as what you've named the control.
Alex Hedley  @Reply  
           
41 days ago
Welcome to the club and good luck on your Learning Connection journey.
Raymond Spornhauer  @Reply  
          
40 days ago
Chuck

Open your form in Design View.
Select the Combo Box.
Change the Name back to 'Statecombo'

Then in your code, change 'ProvID' back to 'Statecombo'

Private Sub Statecombo_GotFocus()

    statecombo.Dropdown

End Sub

***********************************************

The problem you are running into is that you're changing the name in one location, and not the other related locations.
On the Table, the [Field] is named 'State' and is identified by 'StateID'
On the Form, the combobox is named 'Statecombo', which has a bound field: [StateID]
In your Code, the Sub is based on the control name, which should be 'Statecombo'
And the method you are trying to use is [Statecombo.dropdown].

If you change one of these names, they all have to be changed or you will get the errors you are seeing.

Also.... any Tables with Foreign Keys have to be updated, any conditional formatting has to be updated, etc.

-Raymond
Chuck corvec OP  @Reply  
    
40 days ago
Hi Guys

Thank you. I finally figured it out. I was thinkin StateCombo was an actual Access function and not defendant on whether or not that control actually existed in the form. I has been years since I did any of this. It's slowly coming back

Thanks for all the help

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: 5/20/2026 9:13:36 PM. PLT: 1s