Continuous Forms Question! (1 Viewer)

ngsabath93

Registered User.
Local time
Today, 18:29
Joined
Jun 30, 2014
Messages
48
Hi, so I have a main Form (ClientFrm) with a continuous subform (Child Subform) within it based on a Table called Child Table with fields: Child Name, Eye Color, Hair Color, Age, Blood Type, Same Father. On this continuous subform, I have each Client put in a new record, Primary key = child name (text, not number), with corresponding eye color, hair color, age, and blood type. Once they are done putting in all their children, I want them to answer a yes/no question field, "Do they all have the same father?". I do not want do have to answer this question multiple times for each child. Is there any way I can only answer this once for each client and have the Column "Same Father" update for each child of that client? Does that make sense?
 

burrina

Registered User.
Local time
Today, 17:29
Joined
May 10, 2014
Messages
972
Are you saying you want to select multiple check boxes at a time? If so, this may work for you.

Dim ctl As Control 'Select All CheckBoxes.
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then ctl.Value = True
Next ctl
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 08:29
Joined
Jan 20, 2009
Messages
12,854
"Same Father" doesn't really have a meaning in the context of a Child record. What will you do if the family has four children from two fathers?

What the Child record should record is some ID of father. This does not necessarily mean the father needs a record anywhere else. It could be a minimal as recording an index to represent the fathers of the family. eg A,B,C or 1,2,3. This index would be in the Child record along with the Family FK.

BTW. Names make terrible PKs because they are not unique.
 

ngsabath93

Registered User.
Local time
Today, 18:29
Joined
Jun 30, 2014
Messages
48
My real database is much more complicated than this and I just used this example to simplify the question. So what I need is to figure out what I asked above.
 

JHB

Have been here a while
Local time
Tomorrow, 00:29
Joined
Jun 17, 2012
Messages
7,732
My real database is much more complicated than this and I just used this example to simplify the question. So what I need is to figure out what I asked above.
Hmm - then run an update query!
 

vbaInet

AWF VIP
Local time
Today, 23:29
Joined
Jan 22, 2010
Messages
26,374
Hi, so I have a main Form (ClientFrm) with a continuous subform (Child Subform) within it based on a Table called Child Table with fields: Child Name, Eye Color, Hair Color, Age, Blood Type, Same Father. On this continuous subform, I have each Client put in a new record, Primary key = child name (text, not number), with corresponding eye color, hair color, age, and blood type. Once they are done putting in all their children, I want them to answer a yes/no question field, "Do they all have the same father?".
I hope you've taken note of the points that Galaxiom made?

And no your description isn't concise enough. You haven't listed out the fields in your client table and the relationship between the client table and the child table. And how many children can a client have?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 23:29
Joined
Sep 12, 2006
Messages
15,695
if you have a client who cares for children, some of whom may be his own children and some not - then when you add the child you need a way of indicating who the father is.

you could add a button(s) that sets or clears the indicator for all the children.

you could do this either by an update query, or by iterating the recordset /recordset clone and setting all the values with code.

its awkward asking for advice without explaining exactly what data structure you have. The data structure is the most important thing.
 

Users who are viewing this thread

Top Bottom