Resetting a required date field from subsequent fields

C

CES

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
 
G

Guest

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?
 
T

Tim Ferguson

CES said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top