Blank Fields

  • Thread starter Thread starter Michael Nol
  • Start date Start date
M

Michael Nol

Hi

I need to be able to make two form fields blank when I select an item from a
List box. The form fields are text boxes which are of type currency.

Thanks
 
Use the AfterUpdate event procedure of the list box to set the text boxes to
Null:

Private Sub MyList_AfterUpdate()
Me.[Text1] = Null
Me.[Text2] = Null
End Sub
 
Hi Allen

by making these text fields null it wipes the value I have entered. Is there
a way to just make the text disappear??

Thanks

Michael


Allen Browne said:
Use the AfterUpdate event procedure of the list box to set the text boxes to
Null:

Private Sub MyList_AfterUpdate()
Me.[Text1] = Null
Me.[Text2] = Null
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Michael Nol said:
I need to be able to make two form fields blank when I select an item
from
a
List box. The form fields are text boxes which are of type currency.
 
Ok. You coud set their Visible property to No.

This example hides the 2 text boxes if the list box has the value 99:

Private Sub MyList_AfterUpdate()
Dim bShow As Boolean

bShow = Nz(Me.MyListBox <> 99, True)
If Me.Text1.Visible <> bShow Then
Me.[Text1].Visible = bShow
Me.[Text2].Visible = bShow
End If
End Sub

Private Sub Form_Current()
Call MyList_AfterUpdate
End Sub


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Michael Nol said:
Hi Allen

by making these text fields null it wipes the value I have entered. Is there
a way to just make the text disappear??

Thanks

Michael


Allen Browne said:
Use the AfterUpdate event procedure of the list box to set the text
boxes
to
Null:

Private Sub MyList_AfterUpdate()
Me.[Text1] = Null
Me.[Text2] = Null
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Michael Nol said:
I need to be able to make two form fields blank when I select an item
from
a
List box. The form fields are text boxes which are of type currency.
 
Back
Top