when converting to mde vba code does not work

K

Kokanutt

I have a db that was converted to MDE. I am utilizing the User History
Utility. But instead of acHidden I would like for the form to be
forms!myform.visible=false. I do not want this form to be even visible on
the windows taskbar. now i know i can change the options so that no windows
are visible. but only want this form not to be visible. since i use
autoexec to open my form it appears that even the achidden does not work.
but if i use another form's (FRM2) close event to launch MyForm then it is
hidden. so i autoexec FRM2 to open then close but I was back to square one.
Any ideas? I woudl like for MyForm to open hidden and invisible. Why?
Because some of my users are seeing it in the taskbar and selecting it by
accident and then they close it manually. Which then updates my table to say
that they are logged off when they are not.
 
D

David H

First, you can't make any changes to the *.MDE file. You have to modify the
original *.MDB file first and then recreate the *.MDE file. If you don't have
the *.MDB file. Sorry you're out of luck.

Second, when I just executed the following code

docmd.OpenForm "frmForm1",,,,,acHidden

The form name does not appear in my task bar nor under the WINDOW menu. Are
you certain that the form is being opened as acHidden?
Do you have access to the code and can you post it hear?
 
D

David H

First, you can't make any changes to the *.MDE file. You have to modify the
original *.MDB file first and then recreate the *.MDE file. If you don't have
the *.MDB file. Sorry you're out of luck.

Second, when I just executed the following code

docmd.OpenForm "frmForm1",,,,,acHidden

The form name does not appear in my task bar nor under the WINDOW menu. Are
you certain that the form is being opened as acHidden?
Do you have access to the code and can you post it hear?
 
K

Kokanutt

I did the code using my original mdb. then I converted it to mde. Below is
my code and logic. Brace yourself!

FrmSecRights is opened via AutoExec as does the following:
this form is linked to a user permission table (windows ID and security
group are the fields). This form checks the Windows ID to verify they have
the right to open this application. If the user has the right to open this
app then frmLogIn is opened hidden and the Switchboard is open as normal.
See code below re: opening the hidden form.

DoCmd.OpenForm "frmLogIn", , , , , acHidden
DoCmd.OpenForm "switchboard"

Currently in my MDB and MDE the frmLogin is visible in my taskbar.

Tricia
 
K

Kokanutt

I believe I may have figure this out. I had not been using a macro Autoexec.
I was using the Startup option of having my frmSecRights as my start up
form. Now that I have set the startup form to "none" and created an autoexec
macro I don't seem to have this problem anymore. Is this the only way to
solve this problem or shoudl I be able to do this in code. I hope I can do
this in code because otherwise I would have to copy this macro to every FE
mde I create and send out. I don't like macros VBA saves megs and plus I can
hide them with MDE.

By the way thanks for all your help. I really appreciate you taking the
time to help me.
 
D

David H

Kokanutt said:
I believe I may have figure this out. I had not been using a macro Autoexec.
I was using the Startup option of having my frmSecRights as my start up
form. Now that I have set the startup form to "none" and created an autoexec
macro I don't seem to have this problem anymore. Is this the only way to
solve this problem or shoudl I be able to do this in code.

An Autoexec is the only way to have code automatically execute when the
database is opened. However, if you use the RunCode() function you can shift
everything to a VBA function that handles whatever needs to be done.

I hope I can do
this in code because otherwise I would have to copy this macro to every FE
mde I create and send out. I don't like macros VBA saves megs and plus I can
hide them with MDE.

By the way thanks for all your help. I really appreciate you taking the
time to help me.

Once you change the AutoExec to use RunCode() and have it all running
smoothly. You WILL need to recompile and distribute the new Front End.

With all of that being said, it seems as if there is an opportunity to
streamline the overall process.

I suspect that whatever you're using frmSecReights and frmLogIn for can be
streamlined. What specifically does each form do?
 
K

Kokanutt

In response to:
With all of that being said, it seems as if there is an opportunity to
streamline the overall process.

I suspect that whatever you're using frmSecReights and frmLogIn for can be
streamlined. What specifically does each form do?


When the D/B is opened the frmSecRights is opened Hidden
1. verifies user's accessibility and security rights (based on my
Security Rights table) if user can use this D/B then
2. via a VBA sql code - a new record is inserted into the User Log table
which creates a new Session ID; log's the users Windows Login ID; Name (from
the Security Rights table); Offline is changed to False; Database Name (taken
from the Startup's Application Title field) then
3. the frmLogoff form is opened Hidden (this allows the D/B Admin to
force the D/B to close; this forms captures in a field the newly created
Session ID from step 2 above.
4. the Switchboard is then opened maximized
5. frmSecRights is then closed


When users Exit the D/B or the D/B is forced closed by an Admin
1. the frmLogoff form updates the User Log table based on the Session ID
currently held on the Hidden frmLogOff form.
2. Logoff time is recorded; the Comments field is updated to reflect teh
manner of logoff i.e. "Logged Off by Admin" or "User Logged Off".
 

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