store concatenated values in one filed

lico

Registered User.
Local time
Today, 14:20
Joined
Jan 11, 2008
Messages
20
hi guys,
i have a form that contains two controls,
one is a combo box which contains dailing code list
and the other one contains phone number.
both controls are unbound.

i want to store the values from the two controls in one filed on my table.
the reason i wanna do so is because the dailing code might contain two or three digits,
in case it's two, the user maight enter space before or after the two digits, i want to prevent this bacause
i want to be able to srech clients by phone number.

the result stored in the table should look like this:
900-000000
_00-000000

(the first digit is optional the rest are required)

i know that storing concatenated data in one filed isn't recomandded but
since access itself enables input mask just like this for phone numbers i guess it's ok.

i didn't find the way to store this values together,
if anyone have an idea.

thanks :)
 
Id you are not storing the separate parts in the table also but only using then during the data entry process, then sotring the caclulated vaule is not a issue.

The problem I see is with editing the data. If you want to use your two unbound controls, then you will have to split the data and put back into the unbound controls for editing.

If it were me, I would store the parts separately. That would mean the your two unbound controls would be bound to fields in the table.

You would calculate the complete number as needed.

Storing them separately will not make your searchi8ng impossible. Just he opposite. I find that would make it more flexible and more powerful! :)


I have found that following the rules of normalization almost always makes your database more powerful, not less. As with most things, there are exceptions to the rules, but your case is definitely not one of them. The rules of normalization are for exactly for what you are doing.
 
Hi Boyd,
thanks for your replay,

i thought it'll be ok since, aacess itself
gives you the option of input mask that
includes both dailing code and the phone number
in the same field.

anyway i didn't think about editing the data,
which would be a problem if the controls are unbound
as you explaind to me.

is there a way to use two bound controls for feeding data
to the same field?

my form include input of three phone numbers which mean,
that i have to include three more fileds in my table, so i thought
i should try to minimize things.

thanks a lot
 

Users who are viewing this thread

Back
Top Bottom