Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Field taking fouus

Posted on 2004-09-21
Last Modified: 2010-05-02
I am a vb6 developer.  I have problem setting focus on a field if I run the program using the shell statement.  If I run the application not using the shell statement things works fine.
Any answers?
Question by:BHoward

Assisted Solution

avi247 earned 125 total points
ID: 12118232
Could you elaborate with an example\code.
LVL 19

Assisted Solution

arif_eqbal earned 125 total points
ID: 12119576
Use AppActivate after Shell and try
LVL 10

Assisted Solution

anv earned 125 total points
ID: 12119631
hi BHoward

Please elaborate ur question and can u provide us the code ..??
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 19

Accepted Solution

BrianGEFF719 earned 125 total points
ID: 12119692
try using CreateProcess() API.


Author Comment

ID: 12136506
Hi Guys,

I'm trying to help a friend who is new to vb6.  what he is trying to do from a menu item on his primary form, fire up a stand application called phonebook.  as long as he does it using this method

On Error Resume Next
    Response = Shell("Phonebook.exe", 1)  ' Run phonebook.
    AppActivate Response                         ' Activate phonebook
On Error GoTo 0

he is trying to setfocus on a combobox. nothing happens.  in the development mode of phonebook you can run it in the development and everthing works great.  You can execute the compiled phone and its works ok.   it doesn't work using the above code.  

how do you use the CreateProcess() API?



Author Comment

ID: 12136691
Hi Guys,

I solved it myself.  
changing the statement from
   Response = Shell("Phonebook.exe", 1)  ' Run phonebook.
  Response = Shell("Phonebook.exe", vbNormalFocus)  ' Run phonebook.

fixes the problem



Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

840 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