form wont disappear when it has lost focus

G

Guest

Hello everyone,

Im working on a database for a company that does student accomodation and to
take care of the multitude of different things that can be paid ive used a
main ReceiptForm from which you can select what you are paying for and it
opens up that form as a popup.
The problem im having is that when this is great while on the receipt form
as there is a workspace ive left for the popup to appear in (so it looks more
like part of the receipt form) but ive got a problem if i open another form
from the receipt form or even from one of the pop ups cos the pop up still
obscures details on the other forms, how can i make it not do so?? My
thinking is along the lines given below but i dont know what i can use to
make the pop up go behind the current form, any ideas?

Private Sub Form_LostFocus()
'if the popup form has lost focus

If Screen.ActiveForm = "receiptform" Then
'do nothing
Else
'any other form make the popup form disappear

End If

End Sub

With much thanks

Amit
 
G

Guest

Very Form has a Visible property (i.e. Me.Visible). Give this a try on the
Forms Lost Focus Event add this Code:

Me.Visible = False

AND on the Forms Got Focus Event add the Code

Me.Visible = True

When you want the Form to be visible simply set focus to it.

forms!MyFormName.SetFocus

Hope this Helps!

Dean
 
R

RuralGuy

Very Form has a Visible property (i.e. Me.Visible). Give this a try
on the Forms Lost Focus Event add this Code:

Me.Visible = False

AND on the Forms Got Focus Event add the Code

Me.Visible = True

When you want the Form to be visible simply set focus to it.

forms!MyFormName.SetFocus

Hope this Helps!

Dean

AFAIK you can not set focus to an object that is not visible!

HTH
 
G

Guest

hmmm, yeah rural guy has a point though what im thinking is that when you go
back to the receipt form there is an if statement that checks to see if any
of these forms are open if they are it makes them visible so that when you
are back to working the main form it would show up again, ive not tried this
but i think it should work.
Just want to see what you guys think and than you turner, its an ingenious
idea to make it invisible.

With much thanks

Amit
 

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

Top