473,783 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programatically Set Startup Form

How can I programatically set the startup form when the database opens?

Thanks!

Steve
Nov 13 '05 #1
10 16154
PC Datasheet wrote:
How can I programatically set the startup form when the database opens?

Thanks!

Steve


1) Thanks for your help on my sorting question

2) How about have a start up form that's not intended to be opened with
the following in the on open event. the criteria could be based on the
network user name, whether a connection to the backend is able to be
made (test with a simple recordset open), etc, etc, all run before the
air code select statement below.

dim strOpenForm as string

select case <some criteria>

case 1

stropenform = "form1"

case 2

stropenform = "form2"

case else

stropenform = "whatever"

end select

cancel = true 'cancel opening of this form (or hide it for value storage)

docmd.openform stropenForm
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
Tim,

Thanks for your response!

You can go to Tools -Startup and set "MyForn" to open when the database
opens, How do you do this programatically ?

Steve
"Tim Marshall" <TI****@PurpleP andaChasers.Moe rtherium> wrote in message
news:dj******** **@coranto.ucs. mun.ca...
PC Datasheet wrote:
How can I programatically set the startup form when the database opens?

Thanks!

Steve


1) Thanks for your help on my sorting question

2) How about have a start up form that's not intended to be opened with
the following in the on open event. the criteria could be based on the
network user name, whether a connection to the backend is able to be made
(test with a simple recordset open), etc, etc, all run before the air code
select statement below.

dim strOpenForm as string
select case <some criteria>

case 1

stropenform = "form1"

case 2

stropenform = "form2"

case else

stropenform = "whatever"

end select

cancel = true 'cancel opening of this form (or hide it for value storage)

docmd.openform stropenForm
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

Nov 13 '05 #3

"PC Datasheet" <no****@nospam. spam> schreef in bericht news:Ye******** ******@newsread 3.news.atl.eart hlink.net...
How can I programatically set the startup form when the database opens?

Thanks!

Steve


ChangeProperty "StartupFor m", dbText, "YourFormNa me"

Private Function ChangeProperty( strPropName As String, varPropType As Variant, varPropValue As Variant) As Boolean
Dim db As Database, prp As Property
Const conPropNotFound Error = 3270
On Error GoTo Change_Err
Set db = CurrentDb
db.Properties(s trPropName) = varPropValue
ChangeProperty = True
Exit Function

Change_Err:
If Err = conPropNotFound Error Then
Set prp = db.CreateProper ty(strPropName, varPropType, varPropValue)
db.Properties.A ppend prp
Resume Next
Else
ChangeProperty = False
Exit Function
End If
End Function

If the property does not exist yet, it will be created.

Arno R
Nov 13 '05 #4
Create a macro called AutoExec.

Insert an OpenForm command, and enter the name of the form you want to
appear when Access opens.

There are many other things you can do on startup from the AutoExec
macro. Look at the command list to get an idea.

Bob

Nov 13 '05 #5
Thank you!

This falls squarely upon the intent of the newsgroups; ie, to provide help
to Access users.

Now why can't you continue to be a decent human being.

Steve
"Arno R" <ar***********@ tiscali.nl> wrote in message
news:43******** ************@dr eader2.news.tis cali.nl...

"PC Datasheet" <no****@nospam. spam> schreef in bericht
news:Ye******** ******@newsread 3.news.atl.eart hlink.net...
How can I programatically set the startup form when the database opens?

Thanks!

Steve


ChangeProperty "StartupFor m", dbText, "YourFormNa me"

Private Function ChangeProperty( strPropName As String, varPropType As
Variant, varPropValue As Variant) As Boolean
Dim db As Database, prp As Property
Const conPropNotFound Error = 3270
On Error GoTo Change_Err
Set db = CurrentDb
db.Properties(s trPropName) = varPropValue
ChangeProperty = True
Exit Function

Change_Err:
If Err = conPropNotFound Error Then
Set prp = db.CreateProper ty(strPropName, varPropType, varPropValue)
db.Properties.A ppend prp
Resume Next
Else
ChangeProperty = False
Exit Function
End If
End Function

If the property does not exist yet, it will be created.

Arno R
Nov 13 '05 #6

"PC Datasheet" <no****@nospam. spam> schreef in bericht news:G2******** **********@news read1.news.atl. earthlink.net.. .
Thank you!

This falls squarely upon the intent of the newsgroups; ie, to provide help
to Access users.

One minor adjustment:
The newsgroups intent is to provide *free* help to Access users.
Now why can't you continue to be a decent human being.


It's your turn to be decent.

Arno R
Nov 13 '05 #7
"PC Datasheet" <no****@nospam. spam> wrote in
news:p%******** *******@newsrea d3.news.atl.ear thlink.net:
You can go to Tools -Startup and set "MyForn" to open when the
database opens, How do you do this programatically ?


Look up CUSTOM PROPERTIES in Access Help. There's code there to set
custom properties.

Keep in mind that most Access properties don't actually exist until
you set a value. Thus, you can't programmaticall y set the startup
form until you've actually created that property. The code example
in the help file does exactly that, with a SetCustomProper ty
function that works both when the property already exists and when
it doesn't (it uses an error handler to create the property if it
doesn't yet exist).

The code for changing the the property once it's been created is
actually quite trivial:

CurrentDB.Prope rties("StartupF orm") = "MyForm"

I'm not sure where you can get a list of the official property
names, though. You can't just loop through the Properties collection
and output the names in the Debug Window, because the properties
aren't there until a value has been set.

Here's a list of the property names for the properties in the
Startup dialog:

Application Title AppTitle
Application Icon AppIcon
Display Form/Page StartupForm
Display Database Window StartupShowDBWi ndow
Display Status Bar StartupShowStat usBar
Menu Bar StartupMenuBar
Shortcut Menu Bar StartupShortcut MenuBar
Allow Full Menus AllowFullMenus
Allow Default Shortcut Menus AllowShortcutMe nus
Allow Built-In Toolbars AllowBuiltInToo lbars
Allow Toolbar/Menu Changes AllowToolbarCha nges
Allow Viewing Code After Error AllowBreakIntoC ode
Use Access Special Keys AllowSpecialKey s

I suspect that comes from a help topic somewhere, but I can't locate
it -- I'm just copying this from comments I've included in code
where I set the startup properties.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8
"PC Datasheet" <no****@nospam. spam> wrote in
news:G2******** **********@news read1.news.atl. earthlink.net:
This falls squarely upon the intent of the newsgroups; ie, to
provide help to Access users.
You should have checked the Access help files before posting, as
Arno just quoted from the help files.
Now why can't you continue to be a decent human being.


This makes you look like a first-class asshole.

You know that this newsgroup's charter prohibits solitation, yet you
flout those rules anyway. Nonetheless, you expect to get help when
you have a problem.

While I don't think there's any point in trying to get you to stop
soliciting (it's been tried too many times in the past and you're
always too stubborn to change), I think it's pretty assholish to
solicit and then expect to be treated well by the other posters in
the newsgroup.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #9
Good link to find out what the startup and other options you
programatically set.

http://msdn.microsoft.com/library/de...HV05188062.asp

Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2798
by: mark s | last post by:
How can I make a checkbox that says "Do not show this again at startup" on my reminder form? Thanks! -- name: Mark S. email: huskie_009@hotmail.com *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
3523
by: Susan | last post by:
I have a bound form and subform and am trying to enter the data in both forms programatically. The Linkmaster and Linkchild properties are set. My intent is to be able to look at the data before it is saved and then choose to save it or undo it. I have a Save button that just closes the form and a Cancel button that does an undo and then closes the form. I first enter data into the main form and then enter code into the subform. After the...
7
6899
by: cefrancke | last post by:
I cant seem to find a straight answer on the following. I want to programmatically hide all menus except a basic custom report menu (during report preview) and right click pop-up A-Z sorting on datasheets (for subforms). I would like to do this on startup of the application. To be clear:
1
11322
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus Allow Toolbar/Menu Changes Use Access Special Keys
4
1908
by: Tony Vitonis | last post by:
Hello. I've written an app that I want to "live" in the system tray. I want it to start up with just a tray icon showing, and if the user selects "Settings..." from the icon's context menu, to display a window that will allow him to change settings. When he hits "OK" or "Cancel", the window should hide again. At first, I tried putting a "Me.Visible = False" in the form's Load event, but apparently that code runs before the command can...
4
7852
by: Johnnie Miami | last post by:
I'm using VB.Net 2005 beta 2 and have my login form (login.vb) specified as the startup form. If the user is successful logging in, I call my main form (main.vb). This all works fine but the problem is that the login form stays open. I put a me.close (in the login form) after opening the main form but that seems to close everything and the main form is not displayed. I thought I could call a Sub Main() that calls the login form, closes...
10
3003
by: Bernie Hunt | last post by:
This is probably a silly question, but I've gotten myself confused. My app has two forms, form1 and form2. form1 is the start up object in the propers. An event in form1 instantiates form2. Dim myForm as HardwareStore myForm = New HardwareStore myForm.Show() I understand that my form2 can be referenced by
10
22378
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show progress of these tasks on a label on the SplashScreen form. Once this is completed ok, the splash screen should close and the login form should be displayed. A successful login closes that form and shows the main form.
3
4232
by: =?Utf-8?B?UGF1bA==?= | last post by:
I need to programatically upload a text file to a web server using the HTTPWebRequest object within .Net 2.0. So far, I have determined that: - I need a HTTP content-type of "multipart/form-data". - I need to use the ContentType.Boundary property. That is about as far as I have gotten.
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.