Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9150049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:33:38+00:00 2026-06-17T11:33:38+00:00

I have a form in access that contains a recordset that is to be

  • 0

I have a form in access that contains a recordset that is to be populated based on the selection of a dropdown list. I have tested the query and it definitely works if I set the variable data directly. However, I cannot seem to get it to work. I attempted to set the value of a hidden text box in order to see if I could access the data that way, however, I continue to get the Run-time error: 2185 ‘You can’t reference a property or method for a control unless the control has focus.

This is the code in the subroutine:

Private Sub pickdate_AfterUpdate()
  Me![pickdate].SetFocus
  Me![tb_HiddenDate] = Me![pickdate].Text
  Forms!mainForm!subForm.Requery
End Sub

As an aside, if I do Debug.Print(Me![pickdate]) it simply returns the index of the selected item. Same thing for Me![pickdate].Value. Me![pickdate].Text throws the exception, even in the AfterUpdate handler for pickdate.

I have looked into this thread: MS Access: An error in vba of my form, but it does not work in this case. I am at my wit’s end right now trying to figure out why this isn’t working as expected. Anyone have any other suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:33:39+00:00Added an answer on June 17, 2026 at 11:33 am

    Temporarily change the After Update procedure to see what you’re dealing with. Perhaps pickdate includes 2 columns: the first a number; and the second the text you want to retrieve.

    Private Sub pickdate_AfterUpdate()
    Dim i As Long
    Debug.Print "pickdate Value: " & Me![pickdate]
    For i = 0 To (Me.pickdate.ColumnCount - 1)
        Debug.Print "Column " & i, Me.pickdate.Column(i)
    Next
    'Forms!mainForm!subForm.Requery
    End Sub
    

    View the output in the Immediate window (Ctrl+g).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an C# form application that use an access database. This application works
I have an Access 2000 form that contains a combobox. The combobox is bound
I have asp.net form that contains fields. When I access this window, my javascript
I have an access database, with a form, that contains numerous textboxes. The textboxes
I have a bound form in microsoft access that allows a user to add
I have a Microsoft Access form that is bound to a linked SQL Server
I have a sub form in Access: The CopyNo is a combobox that lets
This is the situation. I have a windows form app that uses an access
I have this select input in my form that I want to access via
I have a continuous form that contains a drop down box whos control source

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.