Solved

How to remove focus from Form element when other elements exist

Posted on 2004-05-03
6
911 Views
Last Modified: 2012-08-14
In MSaccess 97 I have a form with no elements that can receive focus (only images and text). When a user presses a button a picklist is made visible and the focus is set on the picklist. When the user is done with the picklist I want to hide the list again but it won't let me set visible = false because the picklist has the focus. I have no other form element to set the focus to.

Is it possible to do something like:  picklist.setfocus = false? When I load the form for the first time there's no element that has the focus. So it should be possible to remove the focus from the only form element that can have focus.

thanks.
0
Comment
Question by:camjai
  • 3
  • 2
6 Comments
 

Author Comment

by:camjai
ID: 10977135
(the buttons on my form are also images)
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 100 total points
ID: 10982985
You may be able to setfocus to the form itself.

[forms]![formname].setfocus

If that doesn't work create a small textbox and set focus there then make your picklist invisible.

The textbox can be hidden by one of the images it just needs to be visible and enabled.

mlmcc
0
 

Author Comment

by:camjai
ID: 10984250
I tried setting focus to the form as you suggested:
[forms]![formname].setfocus
me.setfocus
form.setfocus

none did the trick. I also tried overlaying the textbox with an image but as soon as it gets the focus, the textbox goes solid white and the cursor starts blinking inside it.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 10985494
Make the textbox small and set the background color to the same as the form.  Maybe leave it uncovered.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 11684688
Glad I could help

mlmcc
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now