PC Review


Reply
Thread Tools Rate Thread

when converting to mde vba code does not work

 
 
Kokanutt
Guest
Posts: n/a
 
      10th Feb 2009
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.
 
Reply With Quote
 
 
 
 
David H
Guest
Posts: n/a
 
      10th Feb 2009
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?

"Kokanutt" wrote:

> 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.

 
Reply With Quote
 
David H
Guest
Posts: n/a
 
      10th Feb 2009
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?

"Kokanutt" wrote:

> 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.

 
Reply With Quote
 
Kokanutt
Guest
Posts: n/a
 
      11th Feb 2009
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


 
Reply With Quote
 
Kokanutt
Guest
Posts: n/a
 
      11th Feb 2009
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.

"David H" wrote:

> 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?
>
> "Kokanutt" wrote:
>
> > 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.

 
Reply With Quote
 
David H
Guest
Posts: n/a
 
      12th Feb 2009


"Kokanutt" wrote:

> 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?

> "David H" wrote:
>
> > 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?
> >
> > "Kokanutt" wrote:
> >
> > > 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.

 
Reply With Quote
 
Kokanutt
Guest
Posts: n/a
 
      17th Feb 2009
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".
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
when converting to mde vba code does not work Kokanutt Microsoft Access Database Table Design 0 10th Feb 2009 11:06 PM
Converting VB code to C# RP Microsoft C# .NET 2 23rd Oct 2007 10:24 AM
When queries fail in VBA code, then work manually, then work in code? AdmiralXizor Microsoft Access Queries 7 20th Jun 2007 12:10 AM
converting this code to C#, how?? Jeff Microsoft ASP .NET 4 23rd Feb 2007 12:36 AM
Needs help converting some pseudo code into VB code williameis Microsoft Excel Programming 2 21st Dec 2006 07:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:52 AM.