Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question about focus on control on form 1

Status
Not open for further replies.

cfvcf

Technical User
Nov 8, 2007
77
US
I have a form with a Report button. When it is clicked a dropdown becomes visible and it displays multiple reports to choose from. When it is clicked another dropdown becomes visible and it displays multiple locations to choose from. When it is clicked I have this code:
DoCmd.OpenReport "Household Inventory", acViewPreview, , _
"[LocationName]=""" & [Forms]![frm_Main_Menu]![combo_Reports_Location] & """"
The reports opens with the correct Location. When the report is closed and the form "Activates", I call a Sub that makes sure all dropdown mades visible are changed to visible = false, but it shows the combo_Reports_Location has focus and I get the error that you cannot change the focus on a control that has focus.
How can I get around this because I want the form to open as it does the first time it opens with only buttons and no combo boxes? Thanks!
 
In your sub [some control name].setfocus before you make the dropdown not visible.
 
Thanks, that's exactly what I needed!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top