create a new3 field by joining fields

eggwater

life as a rehearsal
Local time
Today, 05:59
Joined
Aug 14, 2003
Messages
69
Okay i will have three or four fields that i need to use to create a new field that shows a code based on the data in the other 4 fields .

e.g. if the following is

Location field = 'Manchester'
Rsidence field = 'Brookfield'
Room type field = 'Standard'
Bedding type field = 'With Towel'

These fields need to give a code in a separate field to = MBROSW

please help - if i pull this off i might get promoted
 
You don't need to store this value as it should be calculable anytime from what you have in your four other fields.

Change the field names to suit the controls on your form and add a new textbox with its ControlSource thusly:

=Left([txtLocation], 1) & Left([txtResidence], 3) & Left([txtRoomType], 1) & Left([txtBeddingType], 1)
 
eggwater

the code will in turn be used to calculate costs though - does that matter?
 
Do you have a lookup table with all these codes?
 
lookup table

not yet - why?

for each record there'll be a certain code - each code represents a combination of criteria - as above - the codes eventually become the related field between this (badly developed by an unknown colleague) flat table access database and an SAP database and a multiplier is used obtain a cost...

is this making sense - i'm sure i'm overcomplicating this
 
If you must store the value then you can set an invisible textbox on your control that is bound to the code field and (because I don't know how your form works) use some code to transfer the bit parts that make the code to this hidden textbox.


i.e.

Me.txtHiddenCode = Left([Me.cboLocation], 1) & Left([Me.cboResidence], 3) & Left([Me.cboRoomType], 1) & Left([Me.cboBeddingType], 1)


remembering to reference the column numbers too as I'm assuming you are using combo boxes to select these details.
 
Does not matter much

As long as you are allways taking:
first of Loacation
first 3 of Residence
First of Room type
first of bedding type

Otherwise you cannot use the sollution give by mile

rEgards
 
cheers

I will give these idea a go...

thanks

i will probably be back soon
 

Users who are viewing this thread

Back
Top Bottom