Note also that instead of
Set ctrl.Value = ""
Use
Ctrl.Value = Null ' Not a good idea to set to a zero length string.
mx
Main Topics
Browse All TopicsHow can I clear all the textboxes in a form (I want to use the AfterUpdate Event in a combox) to clear all the textboxes except one the combo box Im using to trigger the code?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The textboxes are use to show a top5 from a recordset, but when I use the simple textbox = it works. This particular combox Im running the code from is a small table I use to let user choose the criteria for the recordset filling the textboxes.
Al I need to do is clear all the textboxes before I run the code to fill them with the records set values.
Im filling these with a top5 but sometimes the top5 query may return less than 5 so I need to clear them before run the code again&
No calculated fields
" Not sure what is going on in your case however."
That is the reason I was asing why it work...or in anohter words why it didnt work before clearing the error. So I should be looking for a textbox (got like 30) that may be rising a calculated field? if the records set is only filling the textboxes why will it be a calcuated field? I got 2 that take a date can this be anohter reason for hte error?
Well, w/o seeing your mdb ... and if you say there are no calculated text box controls, then I don't know off hand what else would result in "Can not assign a value to this object ".
"Author Comments:
" Not sure what is going on in your case however."
That is the reason I was asing why it work...or in anohter words why it didnt work before clearing the error. So I should be looking for a textbox (got like 30) that may be rising a calculated field? if the records set is only filling the textboxes why will it be a calcuated field? I got 2 that take a date can this be anohter reason for hte error?"
>>"So I should be looking for a textbox (got like 30) that may be rising a calculated field?"
Are you positive there are no text boxes with calculated controls? That is about the only reason that error would occur, so ... I used the On error Resume Next.
mx
DatabaseMX:
First of all I want to apologized for not following your instructions correctly;
I keep looking for calculated fields in the form until I found 5! I went one by one in the immediate window unit I came across the value of what I thought I had a label caption (as a title of s subcategory ) as title BUT it was a textbox with a = "(" & top5FirstIssue_TXT.Value & ")" So here is the calculated field!
You were right if you dont have the Db you can debug it, so it was my fault not provide all the right information.
This form had a top5 (5 txtboxes) and the top5 of the top5 (25txt's more) and the titles of these subcategories...you understand mess trying to populate these with a recorset.
DbMX I take my hat again and I evaluate you help as an A+
Thanks
IgnBan
Business Accounts
Answer for Membership
by: DatabaseMXPosted on 2009-11-03 at 09:00:41ID: 25731006
Private Sub MyComboBox_BeforeUpdate(Ca
Dim ctrl As Control
For Each ctrl In Forms("MyForm").Controls
If ctrl.ControlType = acTextBox AND Ctrl.Name<>"ThatTextBoxName"
ctrl.Value = Null ' change here
End If
Next
End Sub