View Full Version : TextBox visible only when used


Robert Saye
06-28-2000, 07:40 AM
Hi all,

I have a form which has five textboxes on it (as well as other info). I have 7 different types of circuit boards I am tracking, and they each have different combinations of programmable logic devices. I have five fields in my Board table, [FPGA, GPHL, PLD1, PLD2, PLD3]. Some of the boards have only one or two of these. I would like to have the ones not being used to disappear while the user is browsing the form. So if they are looking at board type 1 which has a [FPGA, GPHL, and a PLD1] I would like textbxPLD2 and textbxPLD3 to be invisible. Any ideas?

Thanks all.

Travis
06-28-2000, 11:53 AM
Do this on the Form_Current Event. Set the Fields Visible Property to False for those that don't have data.

Robert Saye
06-29-2000, 08:59 AM
Hi me again,

I tried to set them to not visible, this is the code I used. (It didn't work)


Private Sub Form_Current()
If Me.FPGACheckSum = Null Then
Me.FPGACheckSum.Visible = False
If Me.GPHLCheckSum = Null Then
Me.GPHLCheckSum.Visible = False
If Me.PLDCheckSum = Null Then
Me.PLDCheckSum.IsVisible = False
End Sub

Any ideas???

Databyte
06-29-2000, 10:12 PM
If IsNull(Me!YourTextBox) Then Me![Me!YourTextBox].Visible = False
ElseIf IsNull(Me!YourOtherTextBox) Then Me![Me!YourOtherTextBox].Visible = False
End If

Robert Saye
06-30-2000, 05:27 AM
It's me again,

I don't understand what I am doing wrong, once again my code isn't working. Here is the newest version:

Private Sub Form_Current()
If IsNull(Me!FPGACheckSum) Then
Me![Me!FPGACheckSum].Visible = False
ElseIf IsNull(Me!GPHLCheckSum) Then
Me![Me!GPHLCheckSum].Visible = False
ElseIf IsNull(Me!PLDCheckSum) Then
Me![Me!PLDCheckSum].Visible = False
End Sub

Any other ideas??

Thank You,
Robert