Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / October 2005

Tip: Looking for answers? Try searching our database.

What edit mask to use....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad Pears - 27 Oct 2005 18:00 GMT
I have a form field where I want the field to display as blank (no zero) in
it for initial data entry. However, the underlying table has a default value
of 0 in it for that particular field and I want to keep it that way. What
edit mask can I use so that the "0" does not display as the default value in
the field?

Thanks,

Brad
Rick B - 27 Oct 2005 18:23 GMT
Is the field a number field?  If so, it will default to zero.  If it is a
text field, it will (most likely) default to null.

Signature

Rick B

>I have a form field where I want the field to display as blank (no zero) in
>it for initial data entry. However, the underlying table has a default
[quoted text clipped - 5 lines]
>
> Brad
Brad Pears - 27 Oct 2005 18:38 GMT
Yes, the field is an integer. If the field is left blank, I wnat the
underlying table to stiull have a 0 value. I'll explain the problem and
maybe you can suggest an alternative...

I have an application where I was defaulting to 0's for numeric fields.
Problem is that when the user enters a value in there, unless they have
insert turned off, if they enter a value of 10 for instance, it shows as 100
because of the 0 that was already there. This is a pricing app and they are
scared they may wind up overpricing stuff if they arent; careful. on some
fields I can place restrictions like >0 and <50 for instance to catch that
type of thing but not on all fields. Since they are too lazy to just
highlght the field could I automatically select the text in there on focus
event?? Likely I guess. Maybe that would solve the issue...

Thanks, Brad

> Is the field a number field?  If so, it will default to zero.  If it is a
> text field, it will (most likely) default to null.
[quoted text clipped - 8 lines]
>>
>> Brad
Rick B - 27 Oct 2005 19:56 GMT
How are they getting to that field?  If they are in a form and they tab to
it, I'd expect it to highlight the entire field.  If it is not, you might
check your   TOOLS/OPTIONS/KEYBOARD/BEHAVIOR ENTERING FIELD setting.

I've built hundreds of numeric fields and never had to do anything unusual
to compensate for a "zero" value in the field.  I've never had trouble with
users accidentally entering a number to the left of that zero and making it
10 times the intended entry.
Signature

Rick B

> Yes, the field is an integer. If the field is left blank, I wnat the
> underlying table to stiull have a 0 value. I'll explain the problem and
[quoted text clipped - 24 lines]
>>>
>>> Brad
Brad Pears - 27 Oct 2005 20:20 GMT
Well, yes, if they tab to it, it does highlite the entire field. But, if
they siomply click on it with their mouse, it does not. Not to worry though,
I discovered that I can use the .selstart and .sellength properities (see
below example) in the "on click" event to specify that when the user
"clicks" on that textbox, it highlites the entire field.

Placing that code in the "got focus" event does not work as the click event
runs immediately after that - which "deselects" the field!! That's why the
code needs to be placed in the "on click" event.

Thanks for your input.

Sub WindowQty_Click()
' select the text
Me.WindowQty.SelStart = 0
Me.WindowQty.SelLength = Len(Me.WindowQty)
end sub

> How are they getting to that field?  If they are in a form and they tab to
> it, I'd expect it to highlight the entire field.  If it is not, you might
[quoted text clipped - 33 lines]
>>>>
>>>> Brad
Rob Oldfield - 27 Oct 2005 20:28 GMT
Hmmm.  Just to drag out the old quote... make something idiot proof and
they'll just build a better idiot.

> Well, yes, if they tab to it, it does highlite the entire field. But, if
> they siomply click on it with their mouse, it does not. Not to worry though,
[quoted text clipped - 51 lines]
> >>>>
> >>>> Brad
Rob Oldfield - 27 Oct 2005 20:22 GMT
I'd agree with Rick.  It's something that I've never seen happen either.
But, to get the effect you're asking for...

Make the text box unbound. (call it t1)

Add another text box that is bound to the field, and hide it. (call that t2)

In the current event of the form...
if me.t2=0 then
   me.t1=""
else
   me.t1=me.t2
endif

And in the after update event of t1...
me.t2=nz(me.t1,0)

> How are they getting to that field?  If they are in a form and they tab to
> it, I'd expect it to highlight the entire field.  If it is not, you might
[quoted text clipped - 32 lines]
> >>>
> >>> Brad
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.