Text Box Refresh from Combo Box

J

Jani

Not able to figure out this simple thing. MS Access 2003. I have a combo box,
when selection is made, 2 unbound text boxes automatically fill in. Works -
no problem. However, when I move to a new or previous record, the text boxes
retain the information from the previous record and I want them to be blank.
How do I do this? Thanks in advance for your help... as always! Jani
 
D

Dirk Goldgar

Jani said:
Not able to figure out this simple thing. MS Access 2003. I have a combo
box,
when selection is made, 2 unbound text boxes automatically fill in.
Works -
no problem. However, when I move to a new or previous record, the text
boxes
retain the information from the previous record and I want them to be
blank.
How do I do this? Thanks in advance for your help... as always! Jani


I would guess that values are assigned to the text boxes in the AfterUpdate
event of the combo box. You can use code in the form's Current event to set
them to Null:

'------ start of example code ------
Private Sub Form_Current()

Me!txtFirstTextbox = Null
Me!txtSecondTextbox = Null

End Sub
'------ end of example code ------

Substitute the names of your text boxes in the above.
 
R

RonaldoOneNil

In the On Current event of the form put this code

TextBox1Name = ""
TextBox2Name = ""
 
J

Jani

I took the 1st suggestion and it works perfectly. Thanks to both of you for
the quick reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top