Hiding Columns in Subform

Spartacus

New member
Local time
Today, 14:25
Joined
Jun 15, 2005
Messages
7
Hello All!,

The results of a query by users are shown in a subform (in datasheet view) similar to this:

Months 2004-2 2004-3 2004-4 2005-1 2005-2
2004-06 0.9840
2004-07 0.9969
2004-08 0.9800
2004-09 0.9850
2004-10 0.9850
2004-11 0.9879
2004-12 0.9879
2005-01 1.0000
2005-02 0.9900
2005-03 0.9900
2005-04 0.9900
2005-05 0.9900
2005-06 0.9936

The second column onward denotes Years-Quarters. Where I need help is in hiding columns I don't need to show if outside of the range the user's chosen: for example, if user chooses Jul-04 to Mar-05 then I'd like hide columns 2 and 6.

For whatever reason I can't get the monthly values to line up with the Yr-Qtr columns, but I hope you all know what I mean :o, i.e., 2004/07-2004/09 lines up with 2004-3, 2004/10-2004/12 with 2004-4, and so on.

As always, any help provided would be greatly appreciated.
 
I am not sure this will work in Datasheet, but it does in Continuious form. In the form's OnCurrent event, try something like:
If Len(Nz(Me.YourControlName, "")) = 0 Then
Me!YourLabelName.Visible = False
Me!YourControlName.Visible = False
Else
Me!YourLabelName.Visible = True
Me!YourControlName.Visible = True
End If
If there is no data in the txtbox the the txtbox and label are invisible. Datasheet is tricky and you can not do a lot of things in it, but it has its' purpose, I guess. I don't use datasheet for that reason, but the choice is your, try it and see if it works in datasheet. hth.
 

Users who are viewing this thread

Back
Top Bottom