Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Access form invisible 1

Status
Not open for further replies.

Darrylles

Programmer
Feb 7, 2002
1,758
GB
Hi all,

I'm trying to implement a system whereby I can close down an MS Access application across all users via the use of a hidden form with a timer and a table with a 'flag' value.

I've got the code working correctly so that it closes the application dependent on the value in the 'flag' table.

Simplest thing of all: hiding the form so that it runs in the background - and I cannot get the form to run hidden.
This form is the startup form, and I'm using:
[tt]
me.setfocus
me.visible = true
[/tt]

I've tried this in both <On Load> and <On Open> events.

Any help appreciated.

Regards,

Darrylle


Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Remou,

Sorry - typo. Yes, of course I've got "Me.Visible = False".


ATB

Darrylle


Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
p.s.

Access '97

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Would

DoCmd.OpenForm "frmForm", , , , , acHidden

Suit?
 

From VBA Help "SetFocus" method:

"...Other properties can be set only when a control doesn't have the focus. For example, you can't set a control's Visible or Enabled properties to False (0) when that control has the focus...."


TomCologne
 
Hi Remou,

Thanks for your response.

I haven't given enough detail as usual.

This form is the first form called via Tools -> Startup where I don't believe that I can use parameters.


Regards,

Darrylle





Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Tom,

I've tried this with and without setfocus.

However, how would I set the only object (form) to not visible? Where else could the focus go?

Surely this is a common requirement: run an hidden form that runs in the background unseen?

ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
My fault, you already said. This is a mess:

Code:
Private Sub Form_Timer()
If Me.Visible = True Then
Me.Visible = False
End If
Me.TimerInterval = 0
End Sub
 
Remou,

Thanks, I used a workaround (as usual with Access), whereby all other possible forms call this 'shut down' form when they are loaded.

This of course means that I've always got to test to make sure that it's not already loaded.

Access can be a real pain at times.

Thanks all for respopnses.

Regards,

Darrylle


Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Why not DlookUp the flag in the open event of the other forms?
 
What file name did you use for the export file? You must use
Filename.txt

The extension is important, unless you feel like tampering with the registry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top