Invisible fields in a form

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

Guest

Hello, I hope you can help me. This is my issue:

I do have a table which contains 31 fields for holding information regarding
to dates. As days are selected, it is possible that the user select just a
few days instead of all 31 days of the month. I need to hide the fileds
belonging to the number of days not needed.
I count the days and those above the counting should be invisibles in the
form. For doing so, I have tryed the following code without success:

Private Sub Form_Open(Cancel As Integer)
Dim Datum1, Datum2, DatumDif, x
Datum1 = Forms!RoosterDatumSelectie!Datumvan.Value
Datum1 = Forms!RoosterDatumSelectie!DatumTot.Value
DatumDif = DateDiff("d", Datum1, Datum2)
For x = DatumDif + 1 To 31
strDate = "ShiftDtDay" & x
Me.strDate.Visible = False
Next
End sub

Is there anybody who can tell me how can I make those fileds invisibles?

Thank you
 
Hello, I hope you can help me. This is my issue:

I do have a table which contains 31 fields for holding information regarding
to dates. As days are selected, it is possible that the user select just a
few days instead of all 31 days of the month. I need to hide the fileds
belonging to the number of days not needed.

Your table IS INCORRECTLY DESIGNED.

Having table fields with date numbers as the fieldname is improperly
normalized. If you have multiple days for each record, you should have
*two tables* in a one to many relationship. You can use a Subform
based on the second table, which should have one record for each date.

John W. Vinson[MVP]
 
Back
Top