Command button question

G

Guest

Being fairly new to Access, I'm dreaming too big for what I can accomplish on
my own. :)

I'm wondering if there's any way to add a command button (or something) to a
form so that, when clicked, it would add another field to the form.

For example, I'm making this database for our Student Conduct system, and a
person may receive more than one type of probation or counseling as a
sanction, and instead of having blanks for everyone who doesn't get several
types, is there a way where, after entering "general probation" in the
probation field that I could have a button/link to click that would add
another probation drop-down so that I could choose another type of probation?

(If that makes sense. :))

Thanks!!
 
A

Allen Browne

If one incident can involve multiple types of probation, you don't need
another field: you need a related table.

Consider these 3 tables:

Incident table (one record for each incident):
IncidentID AutoNumber primary key
StudentID relates to Student.StudentID
IncidentDate Date/Time
Descrip Memo

Probation table (one record for each type of probation):
ProbationID AutoNumber primary key
Probation Text unique name for this type of
probation.

IncidentProbation table:
IncidentID relates to Incident.IncidentID
ProbationID relates to Probation.ProbationID

So if incident 97 involves 3 types of probation, the table would have 3
records like this:
IncidentID ProbationID
97 1
97 4
97 7

Your Incident form would have a continuous subform bound to the
IncidentProbation table. You add an extra row to the subform for each type
of probation that applies. The combo in the subform where you select the
type of probation will have the Probation table as its RowSource.

Technically, the 3rd table is called a junction table, and this is the
standard way of resolving a many-to-many relation into a pair of one-to-many
relations. For another example, see:
Relationships between Tables (School Grades example)
at:
http://allenbrowne.com/casu-06.html
 

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

Similar Threads

Advanced Query Question 2
forms - how to fill each line in a record 2
Command Button 5
Command Button 6
Command Button Wizard 2
Command button 1
Command Button Wizard 2
Conditional command button 6

Top