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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Field entry dependent on another field value



 
 
Thread Tools Display Modes
  #1  
Old July 13th, 2009, 09:11 AM posted to microsoft.public.access
drw
external usenet poster
 
Posts: 10
Default Field entry dependent on another field value

I am trying to achieve a Yes or No entry in a field "Closed" based upon
whether there is a date inserted in a "Date Closed" field.

If there is a date in the "Date Closed" field, then there should be a "Yes"
in the "Closed" field.

I have tried the Expression Builder in Datasheet view, but the help informs
me that the Tables and Fields are not available in this view to allow me to
choose the field and build an iif type condition.

Any assistance greatly appreciated.

Many thanks.
  #2  
Old July 13th, 2009, 10:34 AM posted to microsoft.public.access
Allen Browne
external usenet poster
 
Posts: 11,706
Default Field entry dependent on another field value

Could there ever be a case where your table should validly have a record
marked as closed but without a date?

If so, you can use the AfterUpdate event procedure of the [Date Closed] text
box on your form to set the value of the yes/no field.

But if not, the best solution would be to leave the yes/no field out of the
table. Then create a query, and type this into the field row in query
design:
IsClosed: ([Date Closed] Is Not Null)

Use the query whereever you would have used the table, and you now have a
yes/no value that can never go wrong and is kept up to date automatically.

More information in:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

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

"DRW" wrote in message
...
I am trying to achieve a Yes or No entry in a field "Closed" based upon
whether there is a date inserted in a "Date Closed" field.

If there is a date in the "Date Closed" field, then there should be a
"Yes"
in the "Closed" field.

I have tried the Expression Builder in Datasheet view, but the help
informs
me that the Tables and Fields are not available in this view to allow me
to
choose the field and build an iif type condition.

Any assistance greatly appreciated.

Many thanks.


  #3  
Old July 14th, 2009, 03:13 PM posted to microsoft.public.access
drw
external usenet poster
 
Posts: 10
Default Field entry dependent on another field value

Many thanks Allen.

However, I've tried your second suggestion, but there must be a slight
syntax error somewhere along the line.

Unfortunately, I only work on this database intermittently, so it will
probably be Thursday before I can look at it again.

"Allen Browne" wrote:

Could there ever be a case where your table should validly have a record
marked as closed but without a date?

If so, you can use the AfterUpdate event procedure of the [Date Closed] text
box on your form to set the value of the yes/no field.

But if not, the best solution would be to leave the yes/no field out of the
table. Then create a query, and type this into the field row in query
design:
IsClosed: ([Date Closed] Is Not Null)

Use the query whereever you would have used the table, and you now have a
yes/no value that can never go wrong and is kept up to date automatically.

More information in:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

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

"DRW" wrote in message
...
I am trying to achieve a Yes or No entry in a field "Closed" based upon
whether there is a date inserted in a "Date Closed" field.

If there is a date in the "Date Closed" field, then there should be a
"Yes"
in the "Closed" field.

I have tried the Expression Builder in Datasheet view, but the help
informs
me that the Tables and Fields are not available in this view to allow me
to
choose the field and build an iif type condition.

Any assistance greatly appreciated.

Many thanks.



 




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


All times are GMT +1. The time now is 08:57 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.