?
Solved

Problem with form!

Posted on 2003-03-21
5
Medium Priority
?
174 Views
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.
0
Comment
Question by:chpchai
5 Comments
 
LVL 2

Expert Comment

by:spauljoseph
ID: 8185429
Just use this code in Form1

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

Expert Comment

by:Jacamar
ID: 8185528
use the

Form1.visible

this property should beable to solve your problem.
0
 

Author Comment

by:chpchai
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
0
 

Author Comment

by:chpchai
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
0
 
LVL 13

Accepted Solution

by:
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
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
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

578 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