data by selection

endri81

Registered User.
Local time
Today, 05:56
Joined
Jul 5, 2010
Messages
121
Hi.
In the case of one mother there are 2 options:
-she has a child YES
-she doesn't have a child NO
If I gave yes I need to specify number of children,and the birthday for each of them.How can these information be represented by table variables?
Is there any shortcut or best practice for this case?
Thank you
 
Hi.
In the case of one mother there are 2 options:
-she has a child YES
-she doesn't have a child NO
If I gave yes I need to specify number of children,and the birthday for each of them.How can these information be represented by table variables?
Is there any shortcut or best practice for this case?
Thank you

table field Child as Yes/No data type
table field numberOfChildren as Number data type

On form either have a check box or a combo box (with Yes/No options) with control source pointing to Child field.
Text field with control source pointing at numberOfChildren field.

Also have the text box display when the check box is checked using code like this...


Code:
Private Sub Form_Current()
If Me.yourtextboxname= -1 Then
  Me.yourtextfield.Visible = True
 Else
  Me.yourtextfield.Visible = False
End If
End Sub
 
 
Private Sub yourtextboxname_AfterUpdate()
 If Me.yourtextboxname= -1 Then
  Me.yourtextfield.Visible = True
 Else
  Me.yourtextfield.Visible = False
  Me.yourtextfield.Value = Null
End If
End Sub
 
I would say a linked "child" table.
Linked on MotherID.

The child table would have a Child ID which would be unique.
The Mother ID (which would not be unique but would link to the mother.)
and then child information.

This would allow for individual child records to be linked to one mother. One mother could have one or many children.
 

Users who are viewing this thread

Back
Top Bottom