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 / July 2005

Tip: Looking for answers? Try searching our database.

SetFocus and Comments Box Behavior

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pamela - 28 Jul 2005 19:48 GMT
Hello,

I am developing a form with page breaks & subforms and am trying to do the
following:

In a subform, I have a comments box.  When the user checks the "Other" check
box, I have the comments field highlighted & move the focus to the comments
box.  When the user clears the "Other" check box, the comments box turns
white.   If the user tried to exit the comments box without entering a
comment (when "Other" is checked), an alert pops up telling them to enter a
comment, & the focus returns to the comments box, forcing the user to enter a
comment.  This all works fine except for one small annoying thing that is
annoying me...

When there is already a comment in the comment box & the user clicks "other",
focus is placed on the comments box but it highlights all the text.  I want
it to go to the end of the line if the comments box is not null...how do I
accomplish this...still learning VBA and am stumped as to how to go about
this.

Thanks!
Marshall Barton - 28 Jul 2005 21:47 GMT
>I am developing a form with page breaks & subforms and am trying to do the
>following:
[quoted text clipped - 13 lines]
>accomplish this...still learning VBA and am stumped as to how to go about
>this.

Typically, you would use the text box's Enter or GotFocus
event to do that.

    Me.thetextbox.SelStart = Len(Nz(Me.thetextbox, "")

Note that the is a common phenemon among users that are
required data that doesn't exist or they don't know - they
just enter any old junk.

Signature

Marsh
MVP [MS Access]

Pamela - 29 Jul 2005 12:47 GMT
Thanks!  I tried it & it worked perfectly.  Learned a new function too (Nz).
:)

I had thought of that (entering junk), so the user ID will be recorded..
something which I now know how to do.   Since this is for quality
review/tracking purposes, I'm hoping they will consider it in their best
interest to enter something meaningful.  I was concerned with a previous
entry accidentally being deleted upon entry into the box, if the comments
were to be edited at a later date.  

>>I am developing a form with page breaks & subforms and am trying to do the
>>following:
[quoted text clipped - 10 lines]
>required data that doesn't exist or they don't know - they
>just enter any old junk.
 
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.