opening form alone no access background (1 Viewer)

felipe_gg

New member
Local time
Today, 02:47
Joined
Mar 15, 2021
Messages
7
hello everyone!

im using a form to retrieve some data and send it via email and
since it has no use to that form to be visible and display that data i wonder if i could just hide everything
i mean clicking the form shortcut, let it work with a macro, send email and then everything closes, just like nothing happened :unsure:
i dont like the idea of access displaying everything it has lol

data sent comes from sql linked tables and is retrieved with a simple query
 

June7

AWF VIP
Local time
Yesterday, 22:47
Joined
Mar 9, 2014
Messages
5,466
Title says you want to open form and hide Access framework - common topic, start with https://www.alvechurchdata.co.uk/hints-and-tips/acchide.html. But narrative sounds like you don't even want to display form. Why does a form need to open? Possible to set code to execute when db opens - an autoexec macro can call a VBA function.
 

Isaac

Lifelong Learner
Local time
Yesterday, 23:47
Joined
Mar 14, 2017
Messages
8,777
I don't see any reason why you couldn't open the form and set its visible property to false - did that not work? But I'd suggest using code, not macros.
 

isladogs

MVP / VIP
Local time
Today, 07:47
Joined
Jan 14, 2017
Messages
18,209
You can easily hide the Access application interface. See Control Application Interface - Mendip Data Systems.
You can also create a desktop shortcut to open your form minimized and using the above code, you will see nothing on the desktop...just a taskbar icon.
With a bit more effort, you can even prevent the taskbar icon appearing as well. However, do bear in mind the need to return to your app if a problem occurs , especially during development.

Or perhaps you should consider doing this from the opposite direction and consider automating Access from Outlook.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:47
Joined
Feb 28, 2001
Messages
27,148
There IS such a thing as launching a database using the command-line /X option which names a macro to be executed. You COULD include a macro action such as RunCode (which for macros must be a FUNCTION, not a SUB). That function could then do stuff for you and, if launched behind the scenes, would not necessarily be visible as an app. (I.e. all background.)


Note that the Access command-line switches in the above articlae are near the bottom of a really long page.

IF you go the way of the macro, a couple of special warnings are in order. ALWAYS remember to close whatever you open. More specifically, if you are opening Outlook, remember to tell it to close & quit. AND include the last step of the macro as Application.Quit, ONLY after you have closed everything else via whatever was in the RunCode.

Failure to close what you open (when involving things that CAN have lives of their own) would lead to "dangling" instances of Outlook or Access. Launching something in this way does not associate the keyboard & screen as the input and output primary channels for the processes involved. All the commands they are going to get will come from the macro, so you have to be extra careful to assure closure in the macro. Otherwise, they just sit there when the macro exits, waiting for Godot (the guy who never comes...)
 

isladogs

MVP / VIP
Local time
Today, 07:47
Joined
Jan 14, 2017
Messages
18,209
I wasn't expecting a Beckett reference in this thread...here's another Beckett quote
Try again. Fail again. Fail better

Going to add that to my signature line
 
Last edited:

felipe_gg

New member
Local time
Today, 02:47
Joined
Mar 15, 2021
Messages
7
oke long story short
first i needed a form to add some records and send the last registry as PDF via email
that was done but then i found those sql tables where the record is being inserted directly from the application used in my workplace.
but, i still needed to send that last record so i kept using that form to trigger the report with last record and send it
thats why i need to launch the form alone and keep access hidden

gotta try ur solutions!
😁

perhaps my solution is not the best as im just learning access but man im gonna learn a lot from failing 😄
 

Isaac

Lifelong Learner
Local time
Yesterday, 23:47
Joined
Mar 14, 2017
Messages
8,777
I've read your last post over and over again, and still can't quite understand it.
Your thread title suggests hiding access application; the third line of your original post suggests hiding a form.
I'm confused.

As you begin trying things post back if you get stuck ..
 

bastanu

AWF VIP
Local time
Yesterday, 23:47
Joined
Apr 13, 2010
Messages
1,402
To send the last record you do not need a form, but you do have to decide how you define "last" :). All you need is to use a dMax on a timestamp field in a subquery to give you the last added record.
Cheers,
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:47
Joined
May 7, 2009
Messages
19,230
why not just Hide the navigation pane?
 

Users who are viewing this thread

Top Bottom