PC Review


Reply
Thread Tools Rate Thread

Display form when opening an .mdb

 
 
David Portwood
Guest
Posts: n/a
 
      20th May 2007
I have a shortcut that associates the user with an .mdw and opens my app.
How can I display the main form of the app automatically from this shortcut?


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIFdpY2tlcmF0aA==?=
Guest
Posts: n/a
 
      20th May 2007
Hi David,

You can specify a startup form either by using the Tools > Startup menu
option, or by creating an Autoexec macro. I prefer the macro method--one of
the few times I will ever use a macro--because each action in the macro
executes in a linear fashion. I often times include other startup
configurations, such as a call to a function to check table links, a call to
another function to ensure record level locking for the first user in
(discussed in my Multiuser App. page), etc. If you try to do all this from
VBA code, using a Startup form, you can get inconsistant results. At least
that has been my experience.

If you have a situation where you want to open a different startup form,
depending on the user, then I would use code to grab the NTUserID. Then I'd
use that result to open the appropriate form. I suppose you could do it by
specifying a different macro (http://support.microsoft.com/?id=209207) in the
target line of each user's shortcut, using the /x macroname option, but
that's going to be a higher maintenance solution. Also, it would require that
the user always use the shortcut to start your application. If they simply
double-clicked on the .mdb file, that would bypass the /x macroname method.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"David Portwood" wrote:

> I have a shortcut that associates the user with an .mdw and opens my app.
> How can I display the main form of the app automatically from this shortcut?


 
Reply With Quote
 
David Portwood
Guest
Posts: n/a
 
      21st May 2007
I don't know how to create an Autoexec macro so I'll try using the Startup
option within Access. I hope A2000 has that option. As soon as I deploy my
app (and after another week or so of bows and gracious acceptances of
praise: "Kind of you to say so, Mr. President, but really any genius could
have done it") I'll start nudging my boss in the direction of an upgrade.

Btw, your article concerning performance improvements for a split, multiuser
app was very helpful. Thank you very much.

"Tom Wickerath" <AOS168b AT comcast DOT net> wrote in message
news:7723F4E3-7E43-4548-86AD-(E-Mail Removed)...
> Hi David,
>
> You can specify a startup form either by using the Tools > Startup menu
> option, or by creating an Autoexec macro. I prefer the macro method--one
> of
> the few times I will ever use a macro--because each action in the macro
> executes in a linear fashion. I often times include other startup
> configurations, such as a call to a function to check table links, a call
> to
> another function to ensure record level locking for the first user in
> (discussed in my Multiuser App. page), etc. If you try to do all this from
> VBA code, using a Startup form, you can get inconsistant results. At least
> that has been my experience.
>
> If you have a situation where you want to open a different startup form,
> depending on the user, then I would use code to grab the NTUserID. Then
> I'd
> use that result to open the appropriate form. I suppose you could do it by
> specifying a different macro (http://support.microsoft.com/?id=209207) in
> the
> target line of each user's shortcut, using the /x macroname option, but
> that's going to be a higher maintenance solution. Also, it would require
> that
> the user always use the shortcut to start your application. If they simply
> double-clicked on the .mdb file, that would bypass the /x macroname
> method.
>
>
> Tom Wickerath
> Microsoft Access MVP
> https://mvp.support.microsoft.com/profile/Tom
> http://www.access.qbuilt.com/html/ex...tributors.html
> __________________________________________
>
> "David Portwood" wrote:
>
>> I have a shortcut that associates the user with an .mdw and opens my app.
>> How can I display the main form of the app automatically from this
>> shortcut?

>



 
Reply With Quote
 
=?Utf-8?B?VG9tIFdpY2tlcmF0aA==?=
Guest
Posts: n/a
 
      21st May 2007
Hi David,

> I don't know how to create an Autoexec macro so I'll try using the Startup
> option within Access.


There's really nothing special about creating an Autoexec macro
(technically, a macro group), versus any other macro. First, lets clarify the
difference between a macro group and a macro name. A macro group is what you
see in the database window when you click on the macros tab (Access 2003 and
earlier). A macro group can contain one or more named macros within it.

Select the macros group. Click on the New button. A new macro group opens up
in design view. Click on the Save button. Assign the name "Autoexec" (without
the quotes). You've just created your first Autoexec macro (or, more
technically correct, your first Autoexec macro group). However, so far, there
are no assigned actions, so nothing will happen if you run this macro.

Select MsgBox in the Action column. Press the F6 key to toggle to the lower
window. Enter "Hello David!" (again, without the quotes) in the message. Save
the macro. To see it work, close your database and re-open it. You should see
a greeting message. That little test demonstrates how this specially named
macro group can be used to run an Action at database startup. Instead of
MsgBox, you can specify OpenForm as the Action, with the name of the form in
the lower window. You can specify RunCode, with the valid name of a function
in a Public module, if you want to run a function.

I hinted earlier at macro name vs. macro group. When you have a macro open
in design view, you can choose to display an additional column "Macro Name".
The menu option View > Macro Names is used to toggle the display of this
column on and off. You can enter a macro name here. When you run a macro
group, only the first macro name will execute. Processing will stop as soon
as a different macro name is encountered. However, you can certainly specify
a certain macro name to run within a particular macro group. This allows one
to have closely related macros all packaged up within one macro group.

Open the sample Northwind database (Access 2003 and earlier). The macro
group named "Customer Phone List" includes two macros, named "Alpha Buttons"
and "Print". The first three lines include comments only. Similarly, the
Suppliers macro group contains five named macros: Add Products, Review
Products, Show Related Products, Close and Validate Postal Code.

I hope this helps some.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"David Portwood" wrote:

> I don't know how to create an Autoexec macro so I'll try using the Startup
> option within Access. I hope A2000 has that option. As soon as I deploy my
> app (and after another week or so of bows and gracious acceptances of
> praise: "Kind of you to say so, Mr. President, but really any genius could
> have done it") I'll start nudging my boss in the direction of an upgrade.
>
> Btw, your article concerning performance improvements for a split, multiuser
> app was very helpful. Thank you very much.

 
Reply With Quote
 
David Portwood
Guest
Posts: n/a
 
      22nd May 2007
I do know how to create and execute a macro in Access. I did this about a
decade or more ago. So are you telling me Access automatically runs a macro
named "Autoexec" at startup?

"Tom Wickerath" <AOS168b AT comcast DOT net> wrote in message
news:224ADC47-9B7C-4F26-BCD2-(E-Mail Removed)...
> Hi David,
>
>> I don't know how to create an Autoexec macro so I'll try using the
>> Startup
>> option within Access.

>
> There's really nothing special about creating an Autoexec macro
> (technically, a macro group), versus any other macro. First, lets clarify
> the
> difference between a macro group and a macro name. A macro group is what
> you
> see in the database window when you click on the macros tab (Access 2003
> and
> earlier). A macro group can contain one or more named macros within it.
>
> Select the macros group. Click on the New button. A new macro group opens
> up
> in design view. Click on the Save button. Assign the name "Autoexec"
> (without
> the quotes). You've just created your first Autoexec macro (or, more
> technically correct, your first Autoexec macro group). However, so far,
> there
> are no assigned actions, so nothing will happen if you run this macro.
>
> Select MsgBox in the Action column. Press the F6 key to toggle to the
> lower
> window. Enter "Hello David!" (again, without the quotes) in the message.
> Save
> the macro. To see it work, close your database and re-open it. You should
> see
> a greeting message. That little test demonstrates how this specially named
> macro group can be used to run an Action at database startup. Instead of
> MsgBox, you can specify OpenForm as the Action, with the name of the form
> in
> the lower window. You can specify RunCode, with the valid name of a
> function
> in a Public module, if you want to run a function.
>
> I hinted earlier at macro name vs. macro group. When you have a macro open
> in design view, you can choose to display an additional column "Macro
> Name".
> The menu option View > Macro Names is used to toggle the display of this
> column on and off. You can enter a macro name here. When you run a macro
> group, only the first macro name will execute. Processing will stop as
> soon
> as a different macro name is encountered. However, you can certainly
> specify
> a certain macro name to run within a particular macro group. This allows
> one
> to have closely related macros all packaged up within one macro group.
>
> Open the sample Northwind database (Access 2003 and earlier). The macro
> group named "Customer Phone List" includes two macros, named "Alpha
> Buttons"
> and "Print". The first three lines include comments only. Similarly, the
> Suppliers macro group contains five named macros: Add Products, Review
> Products, Show Related Products, Close and Validate Postal Code.
>
> I hope this helps some.
>
>
> Tom Wickerath
> Microsoft Access MVP
> https://mvp.support.microsoft.com/profile/Tom
> http://www.access.qbuilt.com/html/ex...tributors.html
> __________________________________________
>
> "David Portwood" wrote:
>
>> I don't know how to create an Autoexec macro so I'll try using the
>> Startup
>> option within Access. I hope A2000 has that option. As soon as I deploy
>> my
>> app (and after another week or so of bows and gracious acceptances of
>> praise: "Kind of you to say so, Mr. President, but really any genius
>> could
>> have done it") I'll start nudging my boss in the direction of an upgrade.
>>
>> Btw, your article concerning performance improvements for a split,
>> multiuser
>> app was very helpful. Thank you very much.



 
Reply With Quote
 
Joan Wild
Guest
Posts: n/a
 
      22nd May 2007
"David Portwood" <(E-Mail Removed)> wrote in message news:46523d8c$0$4709$(E-Mail Removed)...
>I do know how to create and execute a macro in Access. I did this about a
> decade or more ago. So are you telling me Access automatically runs a macro
> named "Autoexec" at startup?


Yes it does. One can hold down the shiftkey while opening the database to bypass the autoexec macro (it will also bypass anything you set in Tools Startup). You can also disable the shiftkey bypass. Look for 'By Pass Shift Key Code' at Albert Kallal's site http://www.members.shaw.ca/AlbertKal.../msaccess.html


--
Joan Wild
Microsoft Access MVP
 
Reply With Quote
 
=?Utf-8?B?VG9tIFdpY2tlcmF0aA==?=
Guest
Posts: n/a
 
      22nd May 2007
Hi David,

I did not receive an autonotification of your latest reply until 6:10 AM
this morning, nearly 24 hours after you replied! I see Joan picked up this
thread. Thanks Joan.

I think you would do good to invest in a few Access books. Here is a site
that shows lots of good books:

http://www.accessmvp.com/JConrad/acc...ces.html#Books

If you can only afford one book, my recommendation is to pick out a book
written by John Viescas.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"David Portwood" wrote:

> I do know how to create and execute a macro in Access. I did this about a
> decade or more ago. So are you telling me Access automatically runs a macro
> named "Autoexec" at startup?


 
Reply With Quote
 
=?Utf-8?B?VG9tIFdpY2tlcmF0aA==?=
Guest
Posts: n/a
 
      23rd May 2007
> ...nearly 24 hours after....

Did I warn you that my math skills are not so good in the early morning,
before I've had my first cup of coffee? <smile>

The autoreply was delayed by a little over 12 hours, not 24 hours.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"Tom Wickerath" wrote:

> Hi David,
>
> I did not receive an autonotification of your latest reply until 6:10 AM
> this morning, nearly 24 hours after you replied! I see Joan picked up this
> thread. Thanks Joan.
>
> I think you would do good to invest in a few Access books. Here is a site
> that shows lots of good books:
>
> http://www.accessmvp.com/JConrad/acc...ces.html#Books
>
> If you can only afford one book, my recommendation is to pick out a book
> written by John Viescas.
>
>
> Tom Wickerath
> Microsoft Access MVP
> https://mvp.support.microsoft.com/profile/Tom
> http://www.access.qbuilt.com/html/ex...tributors.html
> __________________________________________
>
> "David Portwood" wrote:
>
> > I do know how to create and execute a macro in Access. I did this about a
> > decade or more ago. So are you telling me Access automatically runs a macro
> > named "Autoexec" at startup?

>

 
Reply With Quote
 
=?Utf-8?B?VG9tIFdpY2tlcmF0aA==?=
Guest
Posts: n/a
 
      23rd May 2007
> ...nearly 24 hours after....

Did I warn you that my math skills are not so good in the early morning,
before I've had my first cup of coffee? <smile>

The autoreply was delayed by a little over 12 hours, not 24 hours.


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"Tom Wickerath" wrote:

> Hi David,
>
> I did not receive an autonotification of your latest reply until 6:10 AM
> this morning, nearly 24 hours after you replied! I see Joan picked up this
> thread. Thanks Joan.
>
> I think you would do good to invest in a few Access books. Here is a site
> that shows lots of good books:
>
> http://www.accessmvp.com/JConrad/acc...ces.html#Books
>
> If you can only afford one book, my recommendation is to pick out a book
> written by John Viescas.
>
>
> Tom Wickerath
> Microsoft Access MVP
> https://mvp.support.microsoft.com/profile/Tom
> http://www.access.qbuilt.com/html/ex...tributors.html
> __________________________________________
>
> "David Portwood" wrote:
>
> > I do know how to create and execute a macro in Access. I did this about a
> > decade or more ago. So are you telling me Access automatically runs a macro
> > named "Autoexec" at startup?

>

 
Reply With Quote
 
dbahooker@hotmail.com
Guest
Posts: n/a
 
      23rd May 2007
hey if you want more help from Tom, you could probably call him

I found his address and phone number at zabbasearch.com


TOM G WICKERATH
15851 12TH PL
BELLEVUE, WA 98008 (425) 562-8913






On May 23, 12:32 am, Tom Wickerath <AOS168b AT comcast DOT net> wrote:
> > ...nearly 24 hours after....

>
> Did I warn you that my math skills are not so good in the early morning,
> before I've had my first cup of coffee? <smile>
>
> The autoreply was delayed by a little over 12 hours, not 24 hours.
>
> TomWickerath
> Microsoft Access MVPhttps://mvp.support.microsoft.com/profile/Tomhttp://www.access.qbuilt.com/html/expert_contributors.html
> __________________________________________
>
>
>
> "TomWickerath" wrote:
> > Hi David,

>
> > I did not receive an autonotification of your latest reply until 6:10 AM
> > this morning, nearly 24 hours after you replied! I see Joan picked up this
> > thread. Thanks Joan.

>
> > I think you would do good to invest in a few Access books. Here is a site
> > that shows lots of good books:

>
> > http://www.accessmvp.com/JConrad/acc...ces.html#Books

>
> > If you can only afford one book, my recommendation is to pick out a book
> > written by John Viescas.

>
> >TomWickerath
> > Microsoft Access MVP
> >https://mvp.support.microsoft.com/profile/Tom
> >http://www.access.qbuilt.com/html/ex...tributors.html
> > __________________________________________

>
> > "David Portwood" wrote:

>
> > > I do know how to create and execute a macro in Access. I did this about a
> > > decade or more ago. So are you telling me Access automatically runs a macro
> > > named "Autoexec" at startup?- Hide quoted text -

>
> - Show quoted text -



 
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 opening, form to display for specified period =?Utf-8?B?Q1c=?= Microsoft Access Forms 3 8th Oct 2007 01:48 AM
Display a message while the form is opening =?Utf-8?B?TGlu?= Microsoft Access Form Coding 3 13th Jul 2007 03:26 PM
Need help getting a form to display a certain record on opening =?Utf-8?B?UmFscGggTWFscGg=?= Microsoft Access Forms 0 16th Dec 2005 05:29 PM
display no record when first opening form Liz Hansen Microsoft Access Form Coding 1 21st May 2004 11:54 PM
Opening a form to display a given record Greg Microsoft Access ADP SQL Server 1 18th Mar 2004 11:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:32 PM.