Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2004, 01:19 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default Exclude Certain Forms

Hi all,

I was wondering, is it possible to exclude certain forms that you don't want the user to edit? The reason I'm asking this is because I am developing a new Access database that will eventually have a switchboard as well as a dialog box from which to select a form to edit the records of and I don't want the switchboard or any dialog boxes to appear as forms that can be edited.

Thanks in advance,



Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"
__________________
Ben Horne
-------------------------
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old March 14th, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ben

The simplest way to accomplish this is to adapt your naming convention. Give the editable forms your standard prefix (i.e. 'frm') and use something like 'sysfrm' for those that cannot be changed. It'll then be simple to exclude these forms when creating the switchboard and filling your dialog boxes.


Brian Skelton
Braxis Computer Services Ltd.
 
Old March 14th, 2004, 04:52 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Brian,

Thanks for this, I'll try this out.

Quote:
quote:Originally posted by Braxis
 Ben

The simplest way to accomplish this is to adapt your naming convention. Give the editable forms your standard prefix (i.e. 'frm') and use something like 'sysfrm' for those that cannot be changed. It'll then be simple to exclude these forms when creating the switchboard and filling your dialog boxes.


Brian Skelton
Braxis Computer Services Ltd.
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"
 
Old March 14th, 2004, 05:12 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Brian,

I can't get the darn thing to work. I've got the form named as sysfrm_GameSelector. Is this what's causing the problem? Do I have to keep the name at sysfrm. Also, since this a forms dialog box, I used an SQL Statement to retrieve the form names from the MSysObjects table. Should I go into the MSysObjects table and edit the form names there?

Quote:
quote:Originally posted by Flash Junkie
 Brian,

Thanks for this, I'll try this out.

Quote:
quote:Originally posted by Braxis
 Ben

The simplest way to accomplish this is to adapt your naming convention. Give the editable forms your standard prefix (i.e. 'frm') and use something like 'sysfrm' for those that cannot be changed. It'll then be simple to exclude these forms when creating the switchboard and filling your dialog boxes.


Brian Skelton
Braxis Computer Services Ltd.
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"


Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"
 
Old March 15th, 2004, 12:23 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   You can put buttons to all the forms that you don't want your users to edit on a seperate form, then attach this code to the button to the second form from the "switchboard" to password protect it. I am asking if there is anyone who can make the password show up as **** in the input box on another thread.

Change the word "password" to your own password. Also, supply the accurate form names. My "frmNewForm" would be your second "switchboard" form.

'Attached to On Click event of button to Open Form

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub

If strPasswd = "password" Then
DoCmd.OpenForm "frmNewForm", acNormal

Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
Exit Sub
End If

Mike.
P.S. You're not really using the Access Switchboard are you? Make your own form and set it as the start up form. Be sure to hide the database window.

mmcdonal
 
Old March 15th, 2004, 01:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ben

Could you post your SQL statement?

Thanks



Brian Skelton
Braxis Computer Services Ltd.
 
Old March 15th, 2004, 02:31 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Brian,

This is how I have the SQL Statement for the forms dialog box

SELECT [Name] FROM MSysObjects WHERE [Type]=-32768 And Left([Name],1)<>"~" ORDER BY [Name];

Quote:
quote:Originally posted by Braxis
 Ben

Could you post your SQL statement?

Thanks



Brian Skelton
Braxis Computer Services Ltd.
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"
 
Old March 15th, 2004, 02:33 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Mike,

I am using the Access Switchboard. I could create my own form but I just don't have the time or the patience to do it.

Quote:
quote:Originally posted by mmcdonal
 Hi,

You can put buttons to all the forms that you don't want your users to edit on a seperate form, then attach this code to the button to the second form from the "switchboard" to password protect it. I am asking if there is anyone who can make the password show up as **** in the input box on another thread.

Change the word "password" to your own password. Also, supply the accurate form names. My "frmNewForm" would be your second "switchboard" form.

'Attached to On Click event of button to Open Form

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered open Employees form
'If incorrect password entered give message and exit sub

If strPasswd = "password" Then
DoCmd.OpenForm "frmNewForm", acNormal

Else
MsgBox "Sorry, you do not have access to this form", vbOKOnly, "Important Information"
Exit Sub
End If

Mike.
P.S. You're not really using the Access Switchboard are you? Make your own form and set it as the start up form. Be sure to hide the database window.

mmcdonal
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"
 
Old March 15th, 2004, 03:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK

Change the statement to:
Code:
SELECT [Name] FROM MSysObjects WHERE [Type]=-32768 And NOT(Left([Name],1)="~" OR Left([Name],6)="systbl") ORDER BY [Name];

Brian Skelton
Braxis Computer Services Ltd.
 
Old March 15th, 2004, 06:35 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Brian,

I copied your changes to the forms dialog box but it's not working, the forms I don't want to show up in the forms dialog box are.

I have a question, for forms you don't want to show up in the forms dialog box, should I use something like "sysfrm_GameSelector"? I'm a bit on the confused side.

Thanks in advance,

Quote:
quote:Originally posted by Braxis
 OK

Change the statement to:
Code:
SELECT [Name] FROM MSysObjects WHERE [Type]=-32768 And NOT(Left([Name],1)="~" OR Left([Name],6)="systbl") ORDER BY [Name];

Brian Skelton
Braxis Computer Services Ltd.
Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"




Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude Elements in Apply Templates mail4kaja XSLT 18 November 29th, 2008 12:09 PM
Exclude Namespace Atribute bonekrusher XSLT 3 May 4th, 2007 08:18 AM
Using a linkdoc to exclude rows geordaa XSLT 1 August 24th, 2006 11:19 AM
Exclude Nodes seanhaggerty XSLT 1 February 3rd, 2005 06:00 AM
Exclude a field from refreshing Mimi Javascript How-To 2 August 25th, 2003 05:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.