A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Field Validation



 
 
Thread Tools Display Modes
  #1  
Old November 24th, 2005, 03:40 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Field Validation

Hi, in a table I have ytwo date fields. i want to put a validation on the
second field so that it cannot be earlioer than the first field. is this
possible please in a table design?

Thanks
Alex


  #2  
Old November 24th, 2005, 04:04 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Field Validation

Yes, it's possible, but you cannot place this in the Validation Rule of one
of the fields, since you don't know which one will be filled in first.

For comparision between fields use the Validation Rule of the table--entered
in the Properties box (View menu in table design), not the Validation Rule
of the field (lower pane of the table design window.)

The validation rule could be:
EndDate = StartDate

In earlier versions of Access that would have the side-effect of making both
fields required, so you might want to use:
(StartDate Is Null) OR (EndDate Is Null) OR (EndDate = StartDate)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alex H" aph@no-misnet-spam-co-uk wrote in message
...
Hi, in a table I have ytwo date fields. i want to put a validation on the
second field so that it cannot be earlioer than the first field. is this
possible please in a table design?



  #3  
Old November 24th, 2005, 04:08 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Field Validation

Alex H wrote:
Hi, in a table I have ytwo date fields. i want to put a validation
on the second field so that it cannot be earlioer than the first
field. is this possible please in a table design?


Yes, but you have to use a *Table* validation rule, not a *Field* validation
rule because field validation rules are not allowed to reference other fields.

In the property sheet for the table in design view you will find a validation
rule. In that enter...

[SecondDateField] = [FirstDateField]

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #4  
Old November 24th, 2005, 04:52 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Field Validation

Thanks Both - perfect !

Alex

"Alex H" aph@no-misnet-spam-co-uk wrote in message
...
Hi, in a table I have ytwo date fields. i want to put a validation on the
second field so that it cannot be earlioer than the first field. is this
possible please in a table design?

Thanks
Alex




 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo Field Sam General Discussion 12 November 10th, 2005 09:16 PM
validation rule dependent upon another field warnett General Discussion 1 September 24th, 2005 08:03 PM
Field Validation Rule fails in VBA ! Arnaud Lesauvage General Discussion 0 September 7th, 2005 01:57 PM
Syntax needed to get needed reports Frank Lueder New Users 15 January 6th, 2005 08:39 AM
ASK Field Behavior Greg Mailmerge 9 July 2nd, 2004 02:44 PM


All times are GMT +1. The time now is 10:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.