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 / Modules / DAO / VBA / January 2007

Tip: Looking for answers? Try searching our database.

Resetting a required date field from subsequent fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CES - 19 Jan 2007 01:12 GMT
All,
I was wondering if someone might be able to help me with how to properly reset a required date field after you've moved on to a subsequent fields.

By that I mean if you have six fields on a form:

Field1 - Memo Field
Field2 - required - Text field
Field3 - required - Date field
Field4 - Text field
Field5 - Text field
Field6 - Text field

When a user Enters Field4 I want to validate with the user that indeed the data entered in Fields 1-3 is correct.  After they make an affirmative response I disable and lock Fields 1-3.
The problem that I am running into is I can't seem to figure out how to change the date field back to a Null state and variations of me.Field3.value = "" will throw an error unless I immediately assign a new date such as me.Field3.value = "1/1/1900".

Field2 is easy to figure out how to Foo-Reset, I can just use me.Field2.value = "" but how would you do the equivalent with a Date field?

I know that I could just totally reset the form but I would prefer to just reset the required Field2 & Field3 and then set focus back to Field2.

Thanks in advance. - CES
Jim Burke in Novi - 19 Jan 2007 03:00 GMT
When you say the field is required, are you saying it is a bound field that
is required in it's table? Or that the user is required to enter a value and
you check to make sure it's entered? If it's a bound field (i.e. the
ControlSource property is set to a field that the form is bound to) that is a
required field in a table then I'm pretty sure you have to give it a date
value. If not you should be able to set the text field to "" or Null. And if
you do set any variable to "" it's slightly more efficient to use the
built-in VBNullString value. BUt if it's an unbound field I'm pretty sure you
should be able to set it to either "" or Null  - unless you have a validation
rule set in the text field's properties?

> All,
> I was wondering if someone might be able to help me with how to properly reset a required date field after you've moved on to a subsequent fields.
[quoted text clipped - 16 lines]
>
> Thanks in advance. - CES
Tim Ferguson - 22 Jan 2007 16:52 GMT
> When a user Enters Field4 I want to validate with the user that indeed
> the data entered in Fields 1-3 is correct.  

What you are talking about is really a Wizard than a Form. On a form, it
is expected that controls may be accessed in any order and, at any moment
in time, independently of each other. You cannot know that the user won't
fill in the first three and then click with the mouse on control five or
six. Validation should occur at the level either of each individual
control or on the form as a whole.

The Windows Method of doing what you want is to place the controls 1 to 3
on one page and validate the three of them before allowing the user onto
page 2, where presumably the next three will be.

Hope that helps

Tim F
 
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.