View Full Version : Making a text box visible /invisible


Ants
08-24-2000, 07:48 AM
I have created a label in a form that needs to be visible when the invoice due date has been exceeded I have used the following programme in VBA and it does not work. Any suggestions as to why?

Private Sub Form_Current()
If Invoice_Due_Date < Now Then
Dues_outstanding_Label.Visible = True
Else: Dues_outstanding_Label.Visible = False

End If
End Sub

nb
There is another if..then statement before this one within the on current option, would this effect it?

Shall look forward to any suggestions

Jack Cowley
08-24-2000, 08:02 AM
Try this:

Private Sub Form_Current()
If Me![Invoice_Due_Date] <= Date Then
Me![Dues_outstanding_Label].Visible = True
Else: Me![Dues_outstanding_Label].Visible = False

End If
End Sub

Also be sure that you have the names of your Fields spelt correctly and that the format of your Date Field is a date and not text.

Hope this does it for you....

Jack

Ants
08-24-2000, 08:44 AM
Thanks for that and for the quick reply.
I have an option group that does not work (It was an alphabetical index button)and also a command buttons that proceed to the next records. These too do not function. Is their anything I need to do te rectfy this?

Jack Cowley
08-24-2000, 09:42 AM
DoCmd.GoToRecord, ,acNext should move you to the next record in a form. I would need more specifics on the problem with the Option Group. If it is more convenient email me directly....

HTH,
Jack