Dirk,
That doesn't work. here is my code.
Public Function ClearCBOList()
Dim frmCurrentForm As Form
Dim frmCurrentControl As Control
Set frmCurrentForm = Screen.ActiveForm
Set frmCurrentControl = Screen.ActiveControl
Screen.ActiveControl = Null
DoCmd.Requery frmCurrentControl.Name
End Function
It is a public function to clear any Combo box after a selection is made.
The error I get with this code is that "You can't assign a value with this
object" If I use ME it says it is an Invalid use of the Me object.
If I check the value of the variables frmCurrentForm and frmCurrentControl
it is the name that I would expect. I just want to clear the VALUE of the
current control, not the name of the control.
any help would be appreciated.
Sondreli
"Dirk Goldgar" wrote:
> "Sondreli" <(E-Mail Removed)> wrote in message
> news:AA05A840-2AFE-4F98-ABE9-(E-Mail Removed)...
> > I'm writing a routine to change the value of any Active Control to null.
> > I
> > can get the name of the control using ActiveControl.Name but I can't
> > figure
> > out the syntax to change the value of this control. I've tried assigning
> > it
> > to variables but variables aren't working in a:
> >
> > Forms![variable]![variable] = ""
>
>
> ActiveControl -- whether Screen.ActiveControl or the .ActiveControl property
> of a form -- returns a reference to the control itself, so you can just
> assign a value to that reference. For example,
>
> Screen.ActiveControl = Null
>
> or (for the active control on the current form):
>
> Me.ActiveControl = Null
>
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips: www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)
>