|
Home > Archive > MS Access database support > April 2006 > Me!TowFee.DefaultValue = Null -OR- Me!TowFee.DefaultValue = "" ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Me!TowFee.DefaultValue = Null -OR- Me!TowFee.DefaultValue = "" ?
|
|
|
| On frmVehicleEntryForm...
I wanted to change the DefaultValue property
of one of my textbox controls on a form from within
code. I wanted the setting to be no setting - as if
nothing had ever been entered there. First, I used
Me!TowFee.DefaultValue = Null
That returned an error, so I used
Me!TowFee.DefaultValue = ""
That did not return an error. Curious, I decided to read
the A97 HELP on the subject. It said the following:
"In Visual Basic, use a string expression
to set the value of this property."
So. Does that mean if I want to set the DefaultValue property
to 0 (zero) from within VBA that the line should read
Me!TowFee.DefaultValue = "0" ???
Because I've BEEN USING
Me!TowFee.DefaultValue = 0
and this has worked for me quite nicely.
| |
| Ed Robichaud 2006-04-06, 8:29 pm |
| For a field/control type of NUMBER, then it's Me!myField.Value = 0
For a field/control type of TEXT, then it's Me!myField.Value = "0"
-Ed
"MLH" <CRCI@NorthState.net> wrote in message
news:nmca321otvd68f4
rmlgsgeksqj1c5p2ahe@
4ax.com...
> On frmVehicleEntryForm...
>
> I wanted to change the DefaultValue property
> of one of my textbox controls on a form from within
> code. I wanted the setting to be no setting - as if
> nothing had ever been entered there. First, I used
> Me!TowFee.DefaultValue = Null
>
> That returned an error, so I used
> Me!TowFee.DefaultValue = ""
>
> That did not return an error. Curious, I decided to read
> the A97 HELP on the subject. It said the following:
>
> "In Visual Basic, use a string expression
> to set the value of this property."
>
> So. Does that mean if I want to set the DefaultValue property
> to 0 (zero) from within VBA that the line should read
>
> Me!TowFee.DefaultValue = "0" ???
>
> Because I've BEEN USING
> Me!TowFee.DefaultValue = 0
> and this has worked for me quite nicely.
>
| |
|
| Yes, I can - manually. Perhaps from VBA, I should use "Null"???
>Can't you enter Null or 0 in the default box in the property sheet?
|
|
|
|
|