DoFocus Click Event Procedure Problem

Johnrg

Registered User.
Local time
Tomorrow, 12:12
Joined
Sep 25, 2008
Messages
115
Guys,

I have a subform that has combo boxes set behind visible data feilds.

When I tab into or click on the front feild I want the combo box in the background to show so the user can make a selection from the list. Once the user tabs out off, or click out off the cell, the combo box disappears leaving a nice and tidy form!

I have the "tab into" working just fine using GotFocus=DoFocus([Comboboxname])

But, when I use the same code in the click property setting for the front feild "Click=DoFocus([comboboxname])" I get a MS error message saying : you can't hide a control that has focus.

Can anyone let me know how to work around this so when my users click the front feild I get focus on the combo box in the background so the user can make a selection?

Thanks

JohnG
 
I'm not familiar with DoFocus, In fact I get no result when I searched it in the VBA help.

None the less the following should do what you are looking for, if you put it in the Text Box's GotFocus event;
Code:
    Me.ComboName.Visible = True
    Me.ComboName.SetFocus
    Me.TextName.Visible = False

You can then use the following in the Combo's LostFocus event to reverse the above;
Code:
    Me.TextName.Visible = True
    Me.ComboName.Visible = False
    Me.AnyotherControl.SetFocus

You will also want to put the following in the Subform's OnLoad and OnCurrent events;
Code:
    Me.TextName.Visible = True
    Me.ComboName.Visible = False
to ensure that the form displays as you intend it, at all times.
 
DoFocus appears to be a method in the OpenLaszlo internet platform...

Alternatively, is it the name of one of the custom functions in your database?
 

Users who are viewing this thread

Back
Top Bottom