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
|
|||
|
|||
Formatting fields
I want to format a field in a table to take either dates or text. Now if I
format it for "short date" it won't let me type in text ie: N/A or not needed. Can this be done? |
#2
|
|||
|
|||
Formatting fields
Hi,
I would suggest that you not do that. It will cause more problems than it will solve. If you set the field to allow for Null (i.e. not be required) then when it is not available or not needed, just leave it blank. If you need to specify the difference between N/A and not needed create another field to records that piece of information. Such as Reason_for_No_Date which might be a Text field of say two characters; maybe with the following values: NA for N/A or NN for not needed. Clifford Bass "StarrKittrell" wrote: I want to format a field in a table to take either dates or text. Now if I format it for "short date" it won't let me type in text ie: N/A or not needed. Can this be done? |
#3
|
|||
|
|||
Formatting fields
You can also set the format for a text box of a date or numeric field to
display "N/A" if the value is null/empty. -- Duane Hookom Microsoft Access MVP "Clifford Bass" wrote: Hi, I would suggest that you not do that. It will cause more problems than it will solve. If you set the field to allow for Null (i.e. not be required) then when it is not available or not needed, just leave it blank. If you need to specify the difference between N/A and not needed create another field to records that piece of information. Such as Reason_for_No_Date which might be a Text field of say two characters; maybe with the following values: NA for N/A or NN for not needed. Clifford Bass "StarrKittrell" wrote: I want to format a field in a table to take either dates or text. Now if I format it for "short date" it won't let me type in text ie: N/A or not needed. Can this be done? |
#4
|
|||
|
|||
Formatting fields
On Wed, 19 Nov 2008 09:08:11 -0800, StarrKittrell wrote:
I want to format a field in a table to take either dates or text. Now if I format it for "short date" it won't let me type in text ie: N/A or not needed. Can this be done? No! A field in your table is either Date datatype or a Text datatype. You cannot enter text into a Date field, but you can, of course, enter a date as text into a Text field. But then the value is treated as Text, and cannot be sorted or processed as a date without conversion. I would suggest, if the data entered is a Date, make the field a DataTime datatype and simply leave the value blank if it is "N/A". You can always display "N/A" in a report if the field is blank by using an unbound control instead of the DateField control: =IIf(IsNull([DateField]),"N/A",[DateField]) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|