Phil-
That implies that using a WhereCondition to open a form causes this
behavior, but I'm not able to reproduce it. I tried opening a simple form
that allows both form and datasheet view with a filter, and it switches
back and forth just fine. What is the exact code in the macro? And are
you sure there's no code running in Open, Load, or Current of the form?
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <pdk444444@yahoo.co.uk>
Reply-To: <MS_Access_Professionals@yahoogroups.com>
Date: Thursday, November 1, 2012 1:59 PM
To: "MS_Access_Professionals@yahoogroups.com"
<MS_Access_Professionals@yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi John
Further information to try and find out what (in conjunction with the
permissions) is causing the effect I have been getting :-
I have 2 forms to use as examples.
The first form is one that works correctly for all users in both groups
and that form is called directly from a switchboard menu option.
The 2nd form is the one I have had the problem with and is a bit more
complicated
The user selects a Switchboard menu option which runs the macro 'open form
conditional on user'
This macro has logic to open one form for named users and a different form
called 'parameters' for any other users (as I said before all users of the
2 groups fall into this 'else' logic and therefore open 'parameters')
The form parameters has fields to enter values to optionally filter the
records and there are then 2 buttons - one of which uses the field values
entered to pick up the filtered records and the other one is if the user
wants all records - it doesn't matter which way we go from here, we get
the same effect - so I will pick the all records route
clicking the all records button runs the macro 'open form (not 99)'
this macro opens the form but filters out any records with the value 99 in
a particular field (this is why I have to do it via a macro rather than
calling the form directly on the click of the all records button)
Something in this arrangement (along with the permissions described
before) causes the effect
Any ideas?
cheers
Phil
________________________________
From: John Viescas <JohnV@msn.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, 31 October 2012, 16:17
Subject: Re: [MS_AccessPros] First record in a form
Phil-
Conversion is pretty straightforward. Any custom menus and toolbars you
have move to a "user" tab on the Ribbon, but I suppose you've already
discovered that if you have any. Moving up does let you take advantage of
new features available only in the newer database format. Because ULS
will be going away, you'll have to come up with another way to "secure"
your database. The Environ("UserName") function lets you fairly reliably
fetch the Windows login ID of the current user. You perhaps can use that
instead in your existing code. But you will have to add code to "lock
down" forms and reports yourself. For users who have read-only access,
open the form in read only mode. Hide the Navigation Pane, define and set
the "AllowBypassKey" property, and give your users a .accde file to run
that has all the code stripped out of it.
We still haven't figured out why that one form behaves differently with
different security settingsÅ
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Wednesday, October 31, 2012 4:50 PM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi John
I am in an mdb file along with a wif file - user level security seems to
work ok for what I want and I do get returned the correct user name (ie
the logged on user) when I am comparing currentuser() - (and not "admin")
which enables me to apply logic dependent on user.
I came from a 2003 version originally with this database and so stayed
with the mdb format that i am familiar with.
If it is easy to break and is not very reliable then I suppose that is a
concern.
I have no other experience of building databases in the more advanced
format or converting from an older format. What do you recommend? Is a
conversion from an mdb format trouble free? Are there any aspects of an
old database which don't work in the new format? Is it a steep learning
curve to convert? Any good articles covering what is required?
cheeers
Phil
________________________________
From: John Viescas <mailto:JohnV%40msn.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Wednesday, 31 October 2012, 13:15
Subject: Re: [MS_AccessPros] First record in a form
Phil-
No, there is not CurrentGroup function. And if you're using CurrentUser,
that gets you the Access UserID from the old user-level security (ULS)
system. In most cases, it'll return "Admin" - which isn't very useful.
But that tells me you're in an mdb file and have set up user-level
security. Is that true? It's not very reliable and can be easily broken.
As should be obvious to you, ULS was deprecated as of 2007 and only works
in old-style mdb format files. It's not a way to go looking forward.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Wednesday, October 31, 2012 1:36 PM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi John
We are using 2010.
I need to look more closely into differences but the first obvious
difference is that this particular form is called from (on click of a
button) a parameter entry form - I will provide more details later.
Is there a currentgroup() variable ?
cheers
Phil
________________________________
From: John Viescas <mailto:JohnV%40msn.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Wednesday, 31 October 2012, 10:42
Subject: Re: [MS_AccessPros] First record in a form
Phil-
I need to know how these permissions are being enforced. What version of
Access are you using, and if 2003 or earlier, are you using the built-in
Access User-Level security? What is different about this form from the
ones that work regardless of the permission?
I'll just keep asking questions until you stumble on the answer!
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Wednesday, October 31, 2012 11:12 AM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
John
You have asked the key question - you are a true exorcist !!!
In Permissions on this form, the 2 groups were different
the permissions are Open/Run, Read Design, Modify Design and Administer
One group had all of these the other just had Open/Run
The group with Open/Run only was the group which was working properly -
the other group with all the permissions was getting the first record
I took away the 3 permissions and hey presto the current record is now
maintained in moving from datasheet view to form view.
I never imagined that this could be causing this problem - in fact when I
think about it, it must be this in conjunction with something else because
I have other forms with the same permissions setup which work consistently
when moving from datasheet view to form view.
With this in mind could you please explain why having those permissions
could cause the effect I was getting
Thankyou for all your help.
cheers
Phil
________________________________
From: John Viescas <mailto:JohnV%40msn.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Wednesday, 31 October 2012, 9:39
Subject: Re: [MS_AccessPros] First record in a form
Phil-
Are there any restrictions applied to this form? If so, where is it done,
and what are the restrictions?
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Wednesday, October 31, 2012 10:30 AM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi John
Thanks for sticking with me on this one!
The reason for the 2 different groups is only to prevent or restrict
access to certain parts of the database.
For example, there are some reports that groupA can view but GroupB can't
and there are some areas of data where GroupA can delete data but GroupB
can't
These restrictions are achieved in the Manage Users and Permissions area
by setting diiferent permissions to the
reports/forms/queries/macros/tables for the 2 groups.
All logic that has been added does what it needs to do by actions
dependent on currentuser()
As I mentioned briefly before, I maybe could achieve some of this by
testing currentgroup() but I don't know and haven't checked whether such a
variable is available - so this is not relevant to my current problem -
but could you alos please tell me if currentgroup() is valid?
cheers
Phil
PS. Hi Liz - haha - I'm hoping John is my exorcist on this one!
________________________________
From: John Viescas <mailto:JohnV%40msn.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Tuesday, 30 October 2012, 21:20
Subject: Re: [MS_AccessPros] First record in a form
Phil-
What is different about GroupA and GroupB then? You claim that all
authorization is done by user, but then why have two groups? There must
be something that is different about how your app is handled between the
two groups.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Tuesday, October 30, 2012 8:29 PM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi John
the embedded macro 'code' is
Openform
Form Name Form of info
View form
Filter Name
Where condition = [id]=[forms]![FormA]![id]
Data Mode read only
window mode normal
but as i said - this works perfectly for all users.
I have just tried moving userA1 from GroupA to GroupB and then userB1 from
groupB to GroupA and the effect for those 2 users changes.
In other words, whatever is causing the 2 different effects is definitely
to do with the groups and not the individual users
This strengthens my view that the problem must somehow lie in the area of
permissions rather than logic - because I don't have ANY logic that is
based on groups ONLY logic based on users.
?????
cheers
Phil
________________________________
From: John Viescas <mailto:JohnV%40msn.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Tuesday, 30 October 2012, 16:05
Subject: Re: [MS_AccessPros] First record in a form
Phil-
The only event that should be firing is the Current event when switching
between views. I just tried it with a simple form in 2007, and it
maintains the position when switching, but the Current event fires again.
You've got a Requery somewhere or something else is going on to put the
form back on the first row when switching views.
What, exactly, is the code in the Current Event embedded macro?
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Tuesday, October 30, 2012 4:36 PM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi John (and Glenn)
Glenn - I know something is in there somewhere that is causing this and I
accept that I might be blinded by being so close to the problem.
John- to answer your questions
there is an embedded macro in the 'on current' event of FormA which opens
a form (based on a query) of information relating to the current record.
This works fine for both groups of users and there is nothing in it to
distinguish between the 2 types of users.
All of the users in both groups can see the built in access menus /
toolbars / ribbon and the same thing occurs if they use the drop down view
options on the 'home' tab of the ribbon or use the right mouse button to
select form view.
It is not related to how the user is switching views because I am logging
on myself as the different users and using the same switching methods
cheers
Phil
________________________________
From: John Viescas <mailto:JohnV%40msn.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Tuesday, 30 October 2012, 13:50
Subject: Re: [MS_AccessPros] First record in a form
Phil-
Is there any code in "FormA" that runs in the Open, Load, or Current
event? How do users "switch to Form view?" Are users allowed to use the
built-in Access menus / toolbars / Ribbon?
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: Phil Knowles <mailto:pdk444444%40yahoo.co.uk>
Reply-To: <mailto:MS_Access_Professionals%40yahoogroups.com>
Date: Tuesday, October 30, 2012 2:22 PM
To: "mailto:MS_Access_Professionals%40yahoogroups.com"
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: Re: [MS_AccessPros] First record in a form
Hi Glenn
Thanks for your prompt reply.
There is no logic in the whole system that differentiates between either
GroupA or GroupB or the users in those 2 groups - any logic that there is
is to deal with users of GroupC - users of groupA and groupB always fall
into the 'else' logic of an IF statement and therefore all conditions
should be exactly the same. Or should they?
The only differences between GroupA and GroupB users lie in the
permissions area.
cheers
Phil
________________________________
From: Glenn Lloyd <mailto:argeedblu%40gmail.com>
To: mailto:MS_Access_Professionals%40yahoogroups.com
Sent: Tuesday, 30 October 2012, 11:22
Subject: RE: [MS_AccessPros] First record in a form
Phil,
It is difficult to diagnose this sort of problem without being able to see
the actual form and the code associated with it, or at least the code. My
guess is that there is something in either the Load or Open event handler
for the form that tests either the user name or group and adjusts the
recordset accordingly.
Glenn
From: mailto:MS_Access_Professionals%40yahoogroups.com
[mailto:mailto:MS_Access_Professionals%40yahoogroups.com] On Behalf Of
Phil Knowles
Sent: October-30-12 7:07 AM
To: mailto:MS_Access_Professionals%40yahoogroups.com
Subject: Re: [MS_AccessPros] First record in a form
Hi Guys
I got no response on this particular problem and I could really do with
some guidance - I'll try and explain it more fully.
I have 2 groups of user - say GroupA and GroupB
GroupA has 2 users - say UserA1 and User A2
GroupB has 2 users - say UserB1 and UserB2
All the users use FormA with datasheet view as default.
When GroupA users change from datasheet view to form view the record
displayed is whatever record was current in datasheet view but when GroupB
users change views the record displayed is always the first record of the
datasheet view (ie it seems to lose the current record flag)
GroupB has higher privileges than GroupA and I am also in GroupB and in
addition I have ADMINS privileges but it also happens to me. (ie when I
change views I get the first record rather than the current record)
Everything other than permissions is the same for both groups so I have
been searching in there for an answer but am now stuck.
There is some code in a macro to direct a completely different group of
users (GroupC) to a different form based on an If command dependent on
current user along the lines of
if current user()="userC1" then openform FormB else openform FormA
*** [Side Note - I bet I could achieve this by testing current group
rather than current user - is this possible]
Has anyone any ideas about what this could be or how I could track it down?
cheers
Phil
________________________________
From: pdk444444 <mailto:pdk444444%40yahoo.co.uk
<mailto:pdk444444%40yahoo.co.uk> >
To: mailto:MS_Access_Professionals%40yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
Sent: Tuesday, 23 October 2012, 20:39
Subject: [MS_AccessPros] First record in a form
I have a form which my users display in datasheet view and then switch to
form view.
It behaves differently for 2 groups of users.
For one group it retains the record from datasheet view but for the other
group it reverts to the first record.
The group for which it reverts have higher privileges than the other
group!!
What could be causing it to revert to the first record?
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Tidak ada komentar:
Posting Komentar