Problem with form!

Posted on 2003-03-21
Medium Priority
Last Modified: 2010-04-07
if i have a project with two forms, form1 (a button on it) and form2.
I want to click on the button on form1 that load form2. At the same time, form1 is disabled(by form.enable = false) so that only the user finish the operation on form2 can enable form1.

However, how to make sure form2 is always on top of form1? As I click on the taskbar for other program and return to my project, only form1 is shown.
Question by:chpchai
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

Expert Comment

ID: 8185429
Just use this code in Form1

Private Sub Command1_Click()
    Form2.Show vbModal, Me
End Sub

Expert Comment

ID: 8185528
use the


this property should beable to solve your problem.

Author Comment

ID: 8185551
To spauljoseph,
I have tried your code, but the problem still exist..
that is when i click another application on the task bar and then click back  my application, only the form1 is visible... i think form2 is there, but behind the form1

Author Comment

ID: 8185562
Actually, my form2 is set not to shown on taskbar, what i want is when clicking back on form1 on taskbar, i want to show form2 on top of form1
LVL 13

Accepted Solution

Naman Goel earned 80 total points
ID: 8185597
you can use zorder property of form2 to bring it to front
and show it as vbmodal
private sub command1_click()
form2.show vbmodal,me
form1.zorder vbsendtoback
end sub

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 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