472,958 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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

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
4 2024
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Albretch | last post by:
.. Can you define the Character Set for particular tables instead of databases? . Which DBMSs would let you do that? . How do you store in a DBMS i18n'ed users' from input, coming over the web...
6
by: PerryC | last post by:
I have search googles and there are hundreds of tips about AllowByPassKey... however, none works for me... well, perhaps I am too new to such high level functionality that it just does not make...
1
by: ANSWER | last post by:
Hi, Is there any way I could disable someone to create a new database and import all of my tables into his database. I make .mde, disable shift+Enter, make logon module but still my tables are...
1
by: simonmarkjones | last post by:
Hi i'm trying to disable the shift key from allowing users to access the design view. I've done a search in groups and know i need to somehow do AllowBypassKey. Everywhere i look there is code...
3
by: SueB | last post by:
Hi. I have been working on an Access Db for awhile and am very close to being ready to hand it over to the person who requested it. There will be one user and the db will reside on a desktop...
14
by: Sinity | last post by:
Anyone knows the method/codes to disable the clicked button after first click by using .aspx-- to prevent people to click many time when waiting for the server response. I tried to do this by...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
7
by: gokkog | last post by:
Hello, Recently I have the book Programming Pearls. Nice read! Perhaps it is weekend, I cannot understand the following codes well: #define BITSPERWORD 32 #define SHIFT 5 #define MASK 0x1F...
3
by: CanuckChuck | last post by:
I have a code for enabling a command button to password protect the enabling/disabling of the Shift bypass. For some reason though I keep recieving a syntax error when I try to use it. I copied the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.