Clearing entry from a combo/text box

Neimad

Registered User.
Local time
Today, 09:40
Joined
Jul 11, 2007
Messages
19
Hi again :)

This should be simple. I have a box which when checked should unenable a combo box and remove the current entry in the combo box. At the moment I have it so it writes " " into the combo box when its updated. But I have a problem, I cant change the text from outside the combo box. It says i cannot change it while it is not the focus! So I tried putting the code in the combo box during a afterchange event on the condition the box that needs to be ticked is 'yes' and now it clears it everytime i make a change no matter what :confused:
 
If you use the .Value property instead of the .Text property, the control does not need to have the focus.
 
Bingo! :D

Thank you.

One more question, I also need a box to record when the record was last updated. Any idea why =Date() doesnt work in the afterupdate event? :confused:
 
You need to put your code in the BeforeUpdate event of the form.
 
Nope, that doesnt seem to work either. Its just if i change any data on the form, this this box to change to the latest date. :S
 
The code you put in the BeforeUpdate event of the form is:
Me.YourDateField = Now()
...using your Date Field Name of course. I switch to Now() to include the time.
 
done it, Last_Update.Value = Date as code worked! Thanks :)
 

Users who are viewing this thread

Back
Top Bottom