PC Review


Reply
Thread Tools Rate Thread

removing cursor (focus) from a null field

 
 
bretheren
Guest
Posts: n/a
 
      9th Jan 2004

hi peers,

okay this is a bit of a tricky situation to explain but i'll try to be
as simple as possible.

i have a data entry form (bound to a table) with CANCEL and SAVE
buttons. some of the fields i have on this form are required and others
are optional. my problem is to do with the required fields.

although the scenario is somewhat unlikely but i want to be able to
handle it through code. so here it is:

how do i move cursor from a required field AFTER it has been changed.

if the above line makes sense to you, then you don't need to read any
further...but if you'd like to know what exactly i'm talking about then
please keep reading.

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
let's say user is doing some basic data entry and types the wrong data
in one of the required fields. for instance DATE is a required field
and user types in "Car". while doing that, he changes his mind and
clicks on CANCEL to get out of the form. as soon as he click on CANCEL
button (or any other field for that matter) he gets the standard access
error message complaining about invalid data. he deletes "Car" from the
field and clicks CANCEL but this time he gets an error message
complaining about the null value.
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

so after all that explaining (and i hope it was understandable) what
i'd like to do is be able to press the CANCEL button and get out of the
form.

any help will be appreciated.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

 
Reply With Quote
 
 
 
 
Arvin Meyer
Guest
Posts: n/a
 
      9th Jan 2004
As I understand you, what you are trying to accomplish is to escape from the
record. Pushing the escape button twice will take you back to a clean empty
record, or return you to where the record was when you started to edit it.
Keep in mind, that the record is saved if you move to a subform (or
visa-versa).

You can accoumplish the same thing as the above in your code by adding the
following line to your Cancel button, before you discard the record:

Me.Undo
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"bretheren" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> hi peers,
>
> okay this is a bit of a tricky situation to explain but i'll try to be
> as simple as possible.
>
> i have a data entry form (bound to a table) with CANCEL and SAVE
> buttons. some of the fields i have on this form are required and others
> are optional. my problem is to do with the required fields.
>
> although the scenario is somewhat unlikely but i want to be able to
> handle it through code. so here it is:
>
> how do i move cursor from a required field AFTER it has been changed.
>
> if the above line makes sense to you, then you don't need to read any
> further...but if you'd like to know what exactly i'm talking about then
> please keep reading.
>
> /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
> let's say user is doing some basic data entry and types the wrong data
> in one of the required fields. for instance DATE is a required field
> and user types in "Car". while doing that, he changes his mind and
> clicks on CANCEL to get out of the form. as soon as he click on CANCEL
> button (or any other field for that matter) he gets the standard access
> error message complaining about invalid data. he deletes "Car" from the
> field and clicks CANCEL but this time he gets an error message
> complaining about the null value.
> /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
>
> so after all that explaining (and i hope it was understandable) what
> i'd like to do is be able to press the CANCEL button and get out of the
> form.
>
> any help will be appreciated.
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill null fields from last record non-null in that field CS Microsoft Access 3 4th Jan 2008 09:39 AM
when is null field not null? JethroUK© Microsoft Access Form Coding 9 4th May 2006 11:47 PM
date field is Null but only if 2 other dates fields are not Null =?Utf-8?B?SmFtaWVN?= Microsoft Access Queries 5 17th Apr 2006 06:14 PM
field Is Null/Is Not Null criterion and IIf function =?Utf-8?B?Si5ULiBMZWVtYW4=?= Microsoft Access Queries 3 16th Dec 2004 03:01 AM
Null result when combining null field with non-null field in ADP View Lauren Quantrell Microsoft Access Form Coding 8 17th Nov 2003 03:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:38 AM.