Hide Combo boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyone!

I have form in which I four fields that need to be completed everytime a
user QC's a document and finds an error. If there are more than one error,
they will need to fill in these four fields again and again depnding on the
number of errors. Is there a way to make 10 of these row but hide 9 of them
until a selection from the first cbo is made then a second row of these four
fields appear and then when a selection is made from that cbo another row
appears and so on? Or being that I have so many rows that will be needed, am
I better off using a subform?
 
You need two different tables for this: tblDocument and tblDocumentErrors.
The first table will contain (I suppose) information to identify the document
being reviewed.
tblDocument
DocumentID (primary key, or PK)
DocumentName
DocumentRevision
and so forth

The second table will contain errors only.
tblDocumentErrors
ErrorID (PK)
DocumentID (foreign key, or FK)
The four fields

Click Tools > Relationships. Add both tables, and drag DocumentID from one
table on top of DocumentID in the other table. Click Enforce Referential
Integrity. Make a form (frmDocument) with tblDocument as its record source,
and another (frmDocumentErrors) with tblDocumentErrors as its record source.
Set the default view of this second form to Continuous. In form design view,
drag the icon for frmDocumentErrors onto frmDocument, and let go. Now when
you switch to Form view you can enter document information in the main form,
and errors in the subform. There is no limit to the number of errors you can
log.
A few notes: You define the PK field in table design view, but a foreign
key is established in the Relationships window. Your FK field needs to be
the same data type (established in table design view) as the PK field, or if
the PK is autonumber, the FK need to be Number. You will not be entering
data into your FK field. Establishing the relationship and making the
form/subform takes care of that. Use whatever names you like for tables and
fields. I selected the names to simplify my reply.
 
Hi Bruce,

Thank you for responding. I kind of thought the subform was going to be the
alternative. I will be starting this on Monday and will go with your
suggestion. I am not very proficient with subforms but will try my best.
Thank you very much for the detailed step by step instruction. This will make
putting it together much simpler.
 
A subform in this case is essential. In my earliest database I copied a
paper (MS Word, actually) form that had space for ten documents and ten
review comments. Later I saw how limiting that was. If there are twelve
documents I need to use two forms, and if there is one document there is a
lot of extra space on the report. Table relationships as I have described,
and the form/subform setup for data entry and viewing, is basic to relational
databases. Your project, with two tables, one form, and one subform, is
perfect for introducing you to the program. It could get a little more
involved if you will be selecting reviewer names from a list, but it is still
manageable as an intorductory project.
 
Ok, I did everything I believe to a Tee and it seems to work fine except, if
no information is in the subform for a particular record, the whole record
will not show in the query. Am I doing something wrong? I have both tables
related with a QCID fied which is primary autonumber on one and number field
on the other. Please help.

Thanks!!
 
Back
Top