focus

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

Guest

Hi

I've got a form from which my users will select files. If they double click a text box, the open file dialog will appear and they can choose their file. The problem is that after they select their file they need to click out of the text box before any other control will respond. For example, there's a button that basically says "okay get the file". If I select a file, and then hit the button -- I have to hit the button twice. OR if I select a file, go to another text box to get a different type of file, I have to click that other text box before it will hear the double click

Any suggestions

Art
 
Art,

You can give the "Okay, get the file" button the focus with the SetFocus
method:

Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Value = Application.GetOpenFilename
OkayGetTheFileButton.SetFocus

Now the text box no longer has focus, so any button can be clicked, and the
Enter key can also be used for button OkayGetTheFileButton, since it has
focus.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

Art said:
Hi,

I've got a form from which my users will select files. If they double
click a text box, the open file dialog will appear and they can choose their
file. The problem is that after they select their file they need to click
out of the text box before any other control will respond. For example,
there's a button that basically says "okay get the file". If I select a
file, and then hit the button -- I have to hit the button twice. OR if I
select a file, go to another text box to get a different type of file, I
have to click that other text box before it will hear the double click.
 

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

Back
Top