A record problem

E

ericb

I have a table with the following fields :

Username as text
Password as text
allowA as yes/no
allowB as yes/no
allowC as yes/no
....
allowX as yes/no


I want to allow a user to edit a record and I want the procedure to go like
this :

1- create a record template
2- copy the selected record into the template
3- edit the template
4- when finished ask to confirm the changes
5- update the table with the values in the template
6- end

Finally my question, how do I make in VB the template (if that is the
correct word).

The rest I can do, but I can't make that "template" or recordset.

How to ?

Thank you for the help
 
T

TedMi

First of all, you are "committing spreadsheet" by using repeating "allow..."
fields in each record. If your allowables increase, then you must redo all
your procedures that handle this data. What you need is this:

Table User
Username
Password

Table Action
ActionID (Autonumber or other unique identifier
ActionDesc (text describing what is allowed)

Table UserAllow
UserName
ActionID
(primary compound key on UserName and AllowID)

This is a classic many-to-many relation: A user may be allowed many actions,
and an action may be allowed to many users. If a user is allowed multiple
actions, there are multiple records in UserAllow for that user. Unallowed
things are indicated by a *lack* of a record with that AllowID for a user.

What you need is called a form. It should display the information for one
user, showing all of his/her allowed actions in a listbox. Another listbox
should show all of the actions which are *not* allowed to this user. Write
code for the (say) double-click event of each list box to move actions from
one to the other. So if the user clicks on an item in the "not allowed"
list, that item moves to the "allowed" list, and vice-versa. Upon activating
the updating of the table, all of the user's existing action records are
deleted from the UserAllow table, and new ones are created from the form's
allowed list.

Good luck
-TedMi
 
E

ericb

I will clear up my objective. Those fields "AllowA, ..." are referred to by
callback functions of the ribbon.

This form that I want to make is used by the administrator that allows a
particular User to use such and such Tab and/or control groups.

I want to copy the present settings into a record template give him the
chance of changing thing around and then to put the new settings back into
the UserTable after he conformed everything.

It is the template part I have problems with.

How to make one ?
 
T

TedMi

The solution you have attempted is not suitable for Access. You have two
choices to do this correctly: implement a truly relational data structure in
the Access relational database, or go to a spreadsheet which will allow you
to freely edit multiple repeating fields in each row.
-TedMi
 

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