以编程方式设置启动表单 [英] Programatically Set Startup Form
问题描述
如何在数据库打开时以编程方式设置启动表单?
谢谢!
Steve
How can I programatically set the startup form when the database opens?
Thanks!
Steve
推荐答案
PC数据表写道:
PC Datasheet wrote:
如何在数据库打开时以编程方式设置启动表单?
>谢谢!
Steve
How can I programatically set the startup form when the database opens?
Thanks!
Steve
1)感谢您对我的分类问题的帮助
2)如果在开放赛事中有一个不打算用
打开的启动表单怎么样?标准可以基于
网络用户名,是否可以与后端建立连接(使用简单的记录集打开测试等),等等,全部在
空气代码选择声明之前运行。
dim strOpenForm as string
select case< ;一些标准>
案例1
stropenform =" form1"
案例2
stropenform =" form2"
case else
stropenform =" whatever"
结束选择
取消=真''取消此表单的打开(或隐藏它以存储值)
docmd.openform stropenForm
-
Tim http://www.ucs.mun.ca/~tmarshal/
^ o<
/ #)打嗝,打嗝,打嗝? - Quaker Jake
/ ^^Whatcha doin? - 同上TIM-MAY !! - 我
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
Tim,
感谢您的回复!
你可以转到工具-Startup并设置MyForn;当数据库
打开时打开,你如何以编程方式执行此操作?
Steve
Tim Marshall < TI **** @ PurplePandaChasers.Moertherium>在消息中写道
news:dj ********** @ coranto.ucs.mun.ca ...
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****@PurplePandaChasers.Moertherium> wrote in message
news:dj**********@coranto.ucs.mun.ca...
PC数据表写道:
PC Datasheet wrote:
如何在数据库打开时以编程方式设置启动表单?
谢谢!
史蒂夫
How can I programatically set the startup form when the database opens?
Thanks!
Steve
< 1)感谢您对我的分类问题的帮助
2)如果有一个启动表单,打算不打开
以下内容事件。标准可以基于网络用户名,是否能够与后端建立连接(用简单的记录集打开测试等)等,都在空中代码之前运行
选择下面的语句。
dim strOpenForm as string
select case< some criteria>
case 1
stropenform = form1
案例2
stropenform =" form2"
案例
stropenform ="无论什么
结束选择
取消=真''取消此表单的打开(或隐藏它以存储值)
docmd.openform stropenForm
-
Tim http:/ /www.ucs.mun.ca/~tmarshal/
^ o<
/#)" Burp-beep,burp-beep,burp-beep?" - Quaker Jake
/ ^^Whatcha doin? - 同上TIM-MAY !! - 我
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
" PC数据表" <无**** @ nospam.spam> schreef在bericht新闻:Ye ************** @ newsread3.news.atl.earthlink .net ...
"PC Datasheet" <no****@nospam.spam> schreef in bericht news:Ye**************@newsread3.news.atl.earthlink .net...
我怎样才能以编程方式设置启动表格数据库打开了吗?
谢谢!
Steve
How can I programatically set the startup form when the database opens?
Thanks!
Steve
ChangeProperty" StartupForm",dbText," YourFormName" ;
私有函数ChangeProperty(strPropName As String,varPropType As Variant,varPropValue As Variant)As Boolean
Dim db As Database,prp As Property
Const conPropNotFoundError = 3270
On Error GoTo Change_Err
设置db = CurrentDb
db.Properties(strPropName)= varPropValue
ChangeProperty = True
退出函数
Change_Err:
如果Err = conPropNotFoundError那么
设置prp = db.CreateProperty(strPropName,varPropType,varPropValue)
db.Properties.Append prp
继续下一步
否则
ChangeProperty = False
退出函数
结束如果
结束函数
如果该属性不存在然而,它将被创建。
Arno R
ChangeProperty "StartupForm", dbText, "YourFormName"
Private Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Boolean
Dim db As Database, prp As Property
Const conPropNotFoundError = 3270
On Error GoTo Change_Err
Set db = CurrentDb
db.Properties(strPropName) = varPropValue
ChangeProperty = True
Exit Function
Change_Err:
If Err = conPropNotFoundError Then
Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
db.Properties.Append 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
这篇关于以编程方式设置启动表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!