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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|