By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

After adding two new tables the disable shift key codes don't work

P: n/a
Dear All,

I add two new tables to the database and then the disable shift key codes
don't work. These two new tables are actually created by two queries, and
only these two are in the front end, I didn't manage to move them to the
back end. I work with Access 2k under Win XP.

these are the codes that don't work (it worked for more than a year very
well):

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False

End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
ChangeProperty = False
Resume Change_Bye
End If
End Function

Sub SetStartupProperties1()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True

End Sub

-------

I think this will be the last database I made with Access. I am just scared
by its "liabilty".

Please help,

Thank you for your time, I appreciate very much.

Paul

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
What do you mean by "doesn't work"? Have you changed the property to False,
shut down the database then tried to reopen it only to have the shift key
work?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paul T. RONG" <et***@hotmail.com> wrote in message
news:xH******************@news.chello.at...
Dear All,

I add two new tables to the database and then the disable shift key codes
don't work. These two new tables are actually created by two queries, and
only these two are in the front end, I didn't manage to move them to the
back end. I work with Access 2k under Win XP.

these are the codes that don't work (it worked for more than a year very
well):

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False

End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
ChangeProperty = False
Resume Change_Bye
End If
End Function

Sub SetStartupProperties1()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True

End Sub

-------

I think this will be the last database I made with Access. I am just scared by its "liabilty".

Please help,

Thank you for your time, I appreciate very much.

Paul


Nov 13 '05 #2

P: n/a
Doug,

Thank you.

I have a dialog form, through a command button to disable the shift key,
codes go:

----

Private Sub Stopshift_Click()

Dim Password As String

Password = "1d6e5j4r8521d"

If Not IsNull(txtpassword) And StrComp(Me.txtpassword, Password,
vbBinaryCompare) = 0 Then

Call SetStartupProperties

DoCmd.Close

Else
MsgBox "Wrong password, please enter again!", vbOKOnly +
vbExclamation
Me.txtpassword.SetFocus
Me.txtpassword = ""
End If

End Sub

---

through "Call SetStartupProperties" to use the module I posted last night.

It happens when I click the Stopshift buttom, it just does nothing, silence,
waiting several second, then it generates an error, without error number,
and the database shuts down itself.

all those codes I used in another database for more than a year without any
problem.

I tried those codes in another database, they work well.

So only with this database which is still unfinished.

This morning, when I start the problematic database, and tried to go to the
design view of the problematic dialog form, then it generated a warning,
says:"The Visual Basic for Applications is Corrupt".

I am totally shocked and tried 2 hours more in vain. If you met such case
before please help.

Thank you very much,

Paul T. Rong

Bratislava
Slovakia


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> 写入消息新闻
:18********************@rogers.com...
What do you mean by "doesn't work"? Have you changed the property to False, shut down the database then tried to reopen it only to have the shift key
work?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paul T. RONG" <et***@hotmail.com> wrote in message
news:xH******************@news.chello.at...
Dear All,

I add two new tables to the database and then the disable shift key codes don't work. These two new tables are actually created by two queries, and only these two are in the front end, I didn't manage to move them to the
back end. I work with Access 2k under Win XP.

these are the codes that don't work (it worked for more than a year very
well):

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False

End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
ChangeProperty = False
Resume Change_Bye
End If
End Function

Sub SetStartupProperties1()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True

End Sub

-------

I think this will be the last database I made with Access. I am just

scared
by its "liabilty".

Please help,

Thank you for your time, I appreciate very much.

Paul



Nov 13 '05 #3

P: n/a
I deleted the problematic form in Access 2002, and rebuild the form, the
database works in Access 2002 very well, but not in Access 2000.

Paul
"Paul T. RONG" <et***@hotmail.com> 写入消息新闻
:S5******************@news.chello.at...
Doug,

Thank you.

I have a dialog form, through a command button to disable the shift key,
codes go:

----

Private Sub Stopshift_Click()

Dim Password As String

Password = "1d6e5j4r8521d"

If Not IsNull(txtpassword) And StrComp(Me.txtpassword, Password,
vbBinaryCompare) = 0 Then

Call SetStartupProperties

DoCmd.Close

Else
MsgBox "Wrong password, please enter again!", vbOKOnly +
vbExclamation
Me.txtpassword.SetFocus
Me.txtpassword = ""
End If

End Sub

---

through "Call SetStartupProperties" to use the module I posted last night.

It happens when I click the Stopshift buttom, it just does nothing, silence, waiting several second, then it generates an error, without error number,
and the database shuts down itself.

all those codes I used in another database for more than a year without any problem.

I tried those codes in another database, they work well.

So only with this database which is still unfinished.

This morning, when I start the problematic database, and tried to go to the design view of the problematic dialog form, then it generated a warning,
says:"The Visual Basic for Applications is Corrupt".

I am totally shocked and tried 2 hours more in vain. If you met such case
before please help.

Thank you very much,

Paul T. Rong

Bratislava
Slovakia


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> 写入消息新闻
:18********************@rogers.com...
What do you mean by "doesn't work"? Have you changed the property to

False,
shut down the database then tried to reopen it only to have the shift key
work?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paul T. RONG" <et***@hotmail.com> wrote in message
news:xH******************@news.chello.at...
Dear All,

I add two new tables to the database and then the disable shift key

codes don't work. These two new tables are actually created by two queries, and only these two are in the front end, I didn't manage to move them to the back end. I work with Access 2k under Win XP.

these are the codes that don't work (it worked for more than a year very well):

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False

End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
ChangeProperty = False
Resume Change_Bye
End If
End Function

Sub SetStartupProperties1()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "tieniustartup"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True

End Sub

-------

I think this will be the last database I made with Access. I am just

scared
by its "liabilty".

Please help,

Thank you for your time, I appreciate very much.

Paul




Nov 13 '05 #4

P: n/a
Solved. Thank you all who tried to help.

Paul
"Paul T. RONG" <et***@hotmail.com> 写入消息新闻
:OZ*****************@news.chello.at...
I deleted the problematic form in Access 2002, and rebuild the form, the
database works in Access 2002 very well, but not in Access 2000.

Paul
"Paul T. RONG" <et***@hotmail.com> 写入消息新闻
:S5******************@news.chello.at...
Doug,

Thank you.

I have a dialog form, through a command button to disable the shift key,
codes go:

----

Private Sub Stopshift_Click()

Dim Password As String

Password = "1d6e5j4r8521d"

If Not IsNull(txtpassword) And StrComp(Me.txtpassword, Password,
vbBinaryCompare) = 0 Then

Call SetStartupProperties

DoCmd.Close

Else
MsgBox "Wrong password, please enter again!", vbOKOnly +
vbExclamation
Me.txtpassword.SetFocus
Me.txtpassword = ""
End If

End Sub

---

through "Call SetStartupProperties" to use the module I posted last night.

It happens when I click the Stopshift buttom, it just does nothing,

silence,
waiting several second, then it generates an error, without error number, and the database shuts down itself.

all those codes I used in another database for more than a year without

any
problem.

I tried those codes in another database, they work well.

So only with this database which is still unfinished.

This morning, when I start the problematic database, and tried to go to

the
design view of the problematic dialog form, then it generated a warning,
says:"The Visual Basic for Applications is Corrupt".

I am totally shocked and tried 2 hours more in vain. If you met such case before please help.

Thank you very much,

Paul T. Rong

Bratislava
Slovakia


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> 写入消息新闻
:18********************@rogers.com...
What do you mean by "doesn't work"? Have you changed the property to

False,
shut down the database then tried to reopen it only to have the shift key work?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Paul T. RONG" <et***@hotmail.com> wrote in message
news:xH******************@news.chello.at...
> Dear All,
>
> I add two new tables to the database and then the disable shift key

codes
> don't work. These two new tables are actually created by two queries, and
> only these two are in the front end, I didn't manage to move them to the > back end. I work with Access 2k under Win XP.
>
> these are the codes that don't work (it worked for more than a year very > well):
>
> Sub SetStartupProperties()
> Const DB_Text As Long = 10
> Const DB_Boolean As Long = 1
> ChangeProperty "StartupForm", DB_Text, "tieniustartup"
> ChangeProperty "StartupShowDBWindow", DB_Boolean, False
> ChangeProperty "StartupShowStatusBar", DB_Boolean, False
> ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
> ChangeProperty "AllowFullMenus", DB_Boolean, False
> ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
> ChangeProperty "AllowSpecialKeys", DB_Boolean, False
> ChangeProperty "AllowBypassKey", DB_Boolean, False
>
> End Sub
> Function ChangeProperty(strPropName As String, varPropType As

Variant, > varPropValue As Variant) As Integer
> Dim dbs As Object, prp As Variant
> Const conPropNotFoundError = 3270
>
> Set dbs = CurrentDb
> On Error GoTo Change_Err
> dbs.Properties(strPropName) = varPropValue
> ChangeProperty = True
>
> Change_Bye:
> Exit Function
>
> Change_Err:
> If err = conPropNotFoundError Then ' Property not found.
> Set prp = dbs.CreateProperty(strPropName, _
> varPropType, varPropValue)
> dbs.Properties.Append prp
> Resume Next
> Else
> ChangeProperty = False
> Resume Change_Bye
> End If
> End Function
>
> Sub SetStartupProperties1()
> Const DB_Text As Long = 10
> Const DB_Boolean As Long = 1
> ChangeProperty "StartupForm", DB_Text, "tieniustartup"
> ChangeProperty "StartupShowDBWindow", DB_Boolean, True
> ChangeProperty "StartupShowStatusBar", DB_Boolean, True
> ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
> ChangeProperty "AllowFullMenus", DB_Boolean, True
> ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
> ChangeProperty "AllowSpecialKeys", DB_Boolean, True
> ChangeProperty "AllowBypassKey", DB_Boolean, True
>
> End Sub
>
> -------
>
> I think this will be the last database I made with Access. I am just
scared
> by its "liabilty".
>
> Please help,
>
> Thank you for your time, I appreciate very much.
>
> Paul
>
>
>
>
>



Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.