Changing a combo or text box value to null

  • Thread starter Thread starter Roger Withnell
  • Start date Start date
R

Roger Withnell

If I address a control (text or combo box) directly I can change it to
whatever.

If it's name is vControl, then vControl = NULL does the trick.

But if I pass vControl to a function, vControl = Null in the function does
not work.

How do I address the value of a control that has been passed to a function?

Your help very much appreciated.
 
How are you declaring the function, and how are you calling it?

The function should be something like:

Function MyFunction(MyControl As Control)

MyControl = Null

End Function

You should call it as MyFunction(Me.vControl)
 
Many thanks, Douglas.

I wasn't declaring the data type of the function's parameters. That fixed
it.

Douglas J. Steele said:
How are you declaring the function, and how are you calling it?

The function should be something like:

Function MyFunction(MyControl As Control)

MyControl = Null

End Function

You should call it as MyFunction(Me.vControl)
 

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

Back
Top