rwop works

  • Thread starter hireagenius via AccessMonster.com
  • Start date
H

hireagenius via AccessMonster.com

Hey Access Heros, gurus, geeks, and Joan

my rwop works!!!!!!!!!!! Thank you

Here are the steps for the low tech developers like me for users to see only
records in a table they input. This assumes you have security on the
database.

Limiting Permissions for User1:
Back End - Add field called UserID on table1 with no permissions for User1

Limiting records User1 can see to their records:
Front End - create rwop query on table1 which includes field UserID. In query
design grid add field UserID set criteria to =CurrentUser(). This query is
data for form1. It will limit the query results where UserID=User1.


Add field on form1 for UserID set visible=no. Form1 is based on rwop query.

The following will programmitically put the UserID in the UserID field for
new records:

On form1 BeforeUpdate event put the following code to input User1 in the
UserID field of the table1 when a new record is input.

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.[UserID]=CurrentUser()
End Sub


I hope my explanation makes sense and it contributes to the Discussion Group.
Since I am working on a beautiful 75 degree Saturday afternoon in Florida on
this database, can I join the Access geek club?

Charlie
 
J

Joan Wild

hireagenius said:
Add field on form1 for UserID set visible=no. Form1 is based on rwop
query.

The following will programmitically put the UserID in the UserID
field for new records:

On form1 BeforeUpdate event put the following code to input User1 in
the UserID field of the table1 when a new record is input.

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.[UserID]=CurrentUser()
End Sub

That will update the UserID field every time there is a change to the
record. Since they are seeing only their own records, you only need to do
this when the record is created.

If me.newrecord then
me.UserID = CurrentUser()
end if

However an easier way, that requires no code is to just set the default
value of the textbox bound to UserID to
=CurrentUser()
 
H

hireagenius via AccessMonster.com

That sounds better, Joan. Thank you
Charlie

Joan said:
Add field on form1 for UserID set visible=no. Form1 is based on rwop
query.
[quoted text clipped - 8 lines]
Me.[UserID]=CurrentUser()
End Sub

That will update the UserID field every time there is a change to the
record. Since they are seeing only their own records, you only need to do
this when the record is created.

If me.newrecord then
me.UserID = CurrentUser()
end if

However an easier way, that requires no code is to just set the default
value of the textbox bound to UserID to
=CurrentUser()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top