473,232 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,232 software developers and data experts.

work on 2 pop up forms

72 64KB
If u have 2 pop up forms opened, a large one and a smaller one, is there any way they can be both worked on and the smaller one always stay on top? Just like when u work in a form in design view in access, the property sheet is always on top and u can work on both. thanks
Dec 3 '20 #1

✓ answered by twinnyfo

Neruda,

You can add the code that runs on the OnLoad Event anywhere in your form. There is nothing that says it must be in the OnLoad event.

Just make it a public sub/function and refer to it from the other form when you need to:

Expand|Select|Wrap|Line Numbers
  1. Call Forms![FormName].[Sub/FunctionName]
Hope that hepps!

10 6136
jimatqsi
1,271 Expert 1GB
Neruda,
Must they be separate forms, or can one be a sub-form of the other?
Dec 3 '20 #2
Neruda
72 64KB
they are 2 separate pop up forms, the smaller popup opens with a button within a subform of the large form
Dec 3 '20 #3
jimatqsi
1,271 Expert 1GB
Just a guess here, but maybe you could something with the OnFocus of the bigger form. When that form gains the focus you fire an event in the subform that puts the focus on an object in the subform and then then the same event in the main form puts the focus back on itself. So if you switch to another program, both forms might go to the background but when you come back to the main form you will make both forms on top any other open windows.

Jim
Dec 3 '20 #4
isladogs
452 Expert Mod 256MB
Sorry but if both forms are popups, there shouldn't be a problem

If the smaller popup is opened by clicking a button on the larger popup, it should always be on top.

If the second form was already open when the first form is opened, it will go to the back of the 'z-order'. However clicking the button on the first form will restore it to the top.

Very basic example attached.

Of course, clicking on the larger form will restore focus to that and hide the smaller form if located in the same place. But you can click the button again ...
OR just move the smaller form to one side.
OR change the larger form so it isn't a popup!
Attached Files
File Type: zip TwoPopupsExample.zip (18.4 KB, 52 views)
Dec 3 '20 #5
Neruda
72 64KB
how about hide or close the yellow form when it goes to the back?
Dec 13 '20 #6
isladogs
452 Expert Mod 256MB
You can certainly hide or close the smaller (yellow) form when it goes to the back, but why bother? It is effectively hidden anyway
Dec 14 '20 #7
Neruda
72 64KB
I need to close it because I want the formLoad event to run again every time the yellow form is closed, how do you close the form just by focusing on the large form, tried with lost focus event but did not work
Thanks
Dec 15 '20 #8
isladogs
452 Expert Mod 256MB
One simple method is to add code to the Detail_Click event of the large (blue) form which closes the smaller (yellow) form.
To show when the yellow form is being reopened, I've added a message to the Form_Load event of that form.

Adapt as appropriate to suit your requirements.
Attached Files
File Type: zip TwoPopupsExample_v2.zip (21.3 KB, 36 views)
Dec 15 '20 #9
twinnyfo
3,653 Expert Mod 2GB
Neruda,

You can add the code that runs on the OnLoad Event anywhere in your form. There is nothing that says it must be in the OnLoad event.

Just make it a public sub/function and refer to it from the other form when you need to:

Expand|Select|Wrap|Line Numbers
  1. Call Forms![FormName].[Sub/FunctionName]
Hope that hepps!
Dec 15 '20 #10
Neruda
72 64KB
Thank u for your answers, in the end I have done what u suggested and also added this code to hide the smaller form once it loses focus

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.  
  3. ' error trap is used to process situations when not a form is clicked outside of the popup form
  4. On Error GoTo NotForm:
  5.  
  6.     If Me.Name = Screen.ActiveForm.Name Then Exit Sub
  7.  
  8. NotForm:
  9.     Me.TimerInterval = 0
  10.     Me.Visible = False
  11.  
  12. End Sub
Jan 1 '21 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: KK | last post by:
Windows Forms Inheritance, Incomplete? I was playing around with Windows Forms and found out this Forms Inheritance feature. The moment I saw that, I felt this can be used effectively if the...
2
by: KK | last post by:
** Posting it here cause after couple of days no body responded.** I was playing around with Windows Forms and found out this Forms Inheritance feature. The moment I saw that, I felt this can...
4
by: Mark | last post by:
the Following bit of code doesn't work. It seems to respond to the second, starting with 'add iif statement for Good Practice', but not to the first, starting 'add iif statement for archived' ...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: Leon Slutzkin | last post by:
I am teaching myself Access. I prefer to create forms to enter data instead of tables. Where possible I want to use Option Boxes instead of having to input data each time. Each option box in a...
2
by: justdo | last post by:
Hi, I am writing the unit test for our application. It use "listview component" in some functions. The following code work fine and get c = 1 in Windows Application mode, but fail in unit test...
8
by: Ragbrai | last post by:
Howdy All, I have a query that is used for filtering results to be used in a combo box. The query needs to test fields from both a table and then unbound text boxes on the form that also contains...
4
by: Beagle804 | last post by:
OK. I'm very new to Javascript and what I've learned so far has been find snippets of code on the web and using them in my php programs. I put together an application that allows a Reset button to...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.