Got/Lost Focus If/Then Statments

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings...

Is it possible to utilize the If/Then statements with the Got/Lost Focus
commands?

Thanks,
Alfia
 
alfiajamel said:
Is it possible to utilize the If/Then statements with the Got/Lost Focus
commands?


Of course it is. What are you tryimg to do?
 
I have a calendar object on my form. Now the calendar always shows. I only
want the calendar to pop up if some selects that ubound object.
 
Try something like this in the bound control's Enter event:

Me.calendarcontrol.Visible = True

And in the other controls' Exit event:

Me.calendarcontrol.Visible = False
 
Greetings...

I get an error message that states an object with the focus cannot be
hidden. I tried it on the On Exit and On Lost Focus.

Marshall Barton said:
Try something like this in the bound control's Enter event:

Me.calendarcontrol.Visible = True

And in the other controls' Exit event:

Me.calendarcontrol.Visible = False
--
Marsh
MVP [MS Access]

I have a calendar object on my form. Now the calendar always shows. I only
want the calendar to pop up if some selects that ubound object.
 
alfiajamel said:
I get an error message that states an object with the focus cannot be
hidden. I tried it on the On Exit and On Lost Focus.
 
Oops, hit the wrong key.

Right, the Focus must be set somewhere else before making it
invisible. Maybe this will do:

Me.someothercontrol.SetFocus
Me.calendarcontrol.Visible = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Emailing from Form 3
Multi Select 6
Cancel On Lost Focus Event 3
read focus of controls 1
Do Got Focus and Lost Focus DO anything? 3
Lost Focus Woes 7
if statment in case statement 2
Lost My Focus 3

Back
Top