Enter an "X" automatically in a field when Combo Box selection is "No" (1 Viewer)

Djageman

New member
Local time
Yesterday, 19:04
Joined
Dec 18, 2023
Messages
1
Hello! I taught myself access and built a project status board for our office based off of youtube and google. Bear with me as I'm a complete novice....

I'm trying to automatically have an "X" placed in text fields when "No" is selected from a value list.
We have documents/agreements that relate to some projects but not all. If the document is not needed for the project I would like to place an "X" in the related fields (date received (I have this as text instead of date), date requested, expiration date, etc.). All the documents are included on the report based on the form so when there's an "x" people know that document was not needed for that project.
Agreements Example.jpg


Thanks so much in advance for any help!
 
Set the relevant controls in the AfterUpdate event of the combo.
However not sure how you can do that, if those fields are Dates?
 
Hi. Welcome to AWF!
 
Gasman's point is well taken. IF the fields in question are not text fields, you cannot do what you wanted without more complex formatting. If that is for display only and those "x" values are never actually stored, you can make them have a particular displayed value using the IIF function. If they are dates, you can pick an "impossible" date for your project and make those dates the impossible date. For instance, the first PC came into existence in the early 1970s, so if you picked a date such as 1 Jan 1950 (LONG before the first PC was even designed much less built), you could make the box show a value of "X" - and if not that date, just show it as a regular date.

If the fields ARE bound and are text fields, not dates, it is easy to do as Gasman suggested. If the fields ARE bound and ARE date fields, you might have an issue there. If the fields are NOT bound then you can put whatever you want in the text box.
 
Hello! I taught myself access and built a project status board for our office based off of youtube and google. Bear with me as I'm a complete novice....

I'm trying to automatically have an "X" placed in text fields when "No" is selected from a value list.
We have documents/agreements that relate to some projects but not all. If the document is not needed for the project I would like to place an "X" in the related fields (date received (I have this as text instead of date), date requested, expiration date, etc.). All the documents are included on the report based on the form so when there's an "x" people know that document was not needed for that project.
View attachment 111508

Thanks so much in advance for any help!
Yes, you can not easily mix dates and strings in a field. I think a wad of code could be created to do it, but it's not really worth the extra effort, IMO.

Besides, the x doesn't tell you anything an empty cell doesn't.

If you want to highlight the fields in question, conditional formatting can be created to give those controls a different background color when the "Needed" combo box is "No".
 
Not something I have ever done, but could you have extra controls over the date controls, but these are not bound and transparent. Then set these as X if combos are No, and set bound controls with dates when not No and these overlay controls then set to Null? or ZLS.
 
Yes you could ... but as George said is it really worth the effort for something that adds little or no value for end users
 
I hope you are not storing dates as strings. That will lead to other serious problems.
 

Users who are viewing this thread

Back
Top Bottom