Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending a form control as a procedure parameter

Status
Not open for further replies.

SuryaF

Programmer
May 21, 2006
100
DE
Hi guys,
I'm kinda challenged with a little thing.
I've created a little procedure to refresh a combo box. I've put that procedure in a module.
Code:
Sub RefrCombo(ComboCtrl As Control)  'refreshes the control and makes it null if the old value is not in the new list anymore
ComboCtrl.Requery
If IsNull(ComboCtrl.Column(0)) And Not IsNull(ComboCtrl) Then ComboCtrl = Null
End Sub

Now when I run this code from a form with
RefrCombo(me.Combo1) it tells me an Object is required. It looks like it transferes the Value of the object instead of the object itself.

How should I do it?
Thanks!
 
Try either this:
Call RefrCombo(Me!Combo1)
or this:
RefrCombo Me!Combo1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top