different data type

S

senkurion

hello professnols,

In my table I have, among other, two fileds "Activity" and "Accont ID". I
use form to fill the data in the table. If the field "activity " is either
"deposit" or withdraw" the field "Account ID" should read "NA" (data
type=text) but if the field "Activity" is "transfer" then the filed should
wait for the numeric data to be filled(data type=number). so my problem is
can i make a field to accept both type of data ( number and text) ?? please
help
 
D

Douglas J. Steele

Access only allows a field to be of a single data type.

Your only choice would be to use a Text field. However, if you did that,
you'd find it difficult to do arithmetic with the numeric values.

The typical thing is to designate that the field is not required, so that a
Null value will be stored in it when there isn't a value. You can easily
display NA for the null values using the Nz function. You'd create a query
that selects Nz([AccountID], "NA") rather than just selecting AccountID, and
use use that query wherever you would otherwise have used the table.
 
S

senkurion

Thanks for help

Douglas J. Steele said:
Access only allows a field to be of a single data type.

Your only choice would be to use a Text field. However, if you did that,
you'd find it difficult to do arithmetic with the numeric values.

The typical thing is to designate that the field is not required, so that a
Null value will be stored in it when there isn't a value. You can easily
display NA for the null values using the Nz function. You'd create a query
that selects Nz([AccountID], "NA") rather than just selecting AccountID, and
use use that query wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


senkurion said:
hello professnols,

In my table I have, among other, two fileds "Activity" and "Accont ID". I
use form to fill the data in the table. If the field "activity " is either
"deposit" or withdraw" the field "Account ID" should read "NA" (data
type=text) but if the field "Activity" is "transfer" then the filed should
wait for the numeric data to be filled(data type=number). so my problem is
can i make a field to accept both type of data ( number and text) ??
please
help
 
Top