Asign a null value

D

Dylan Moran

How can you asign a null value to a field using VBA?

At the monet I have the following code:

If Me.contract_serviced <> "Inhouse" Then
Me.contract_outsourced_prov_name.Enabled = True
Me.contract_outsourced_prov_name.SetFocus
Else
Me.contract_outsourced_prov_name.Value = ""
Me.contract_outsourced_prov_name.Enabled = False
End If

Now I don't think this makes it a null field, more like a zero length
string, which I think means if I end up doing a report grouped by
contract_outsourced_prov_name it may have a group with a zero length string.
What I want to do is if the user selects "Inhouse" as an option, then delete
what ever is in contract_outsourced_prov_name, make it a null field, so that
I don't have complications later.

Any ideas?
 
D

Dylan Moran

Worked it out. Sorry for wasting time.

Me.contract_outsourced_prov_name.Value = Null

assigns a null value to the field.
 

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

Top