creating a field from existing table fields

J

John Adams

I have 4 fields which are , Company name, address, tel number, machine fault,
i need to put these together on a text field so we can 'copy & paste' them as
a field and SMS them to a person
 
W

Wayne-I-M

Hi John

Not sure how you would sms that details. But to create a combined
(concencated) field.

Create a new query
Right click the "field" row in the 1st column.
Select build.
Insert this
Details: [TableName]![CompanyNameField] &" "&[TableName]![AddressField] &"
"&[TableName]![TelephoneField] &" "&[TableName]![MachineFaultField]

Of cource change the field and table names to what they really are.

Hope this helps

On the sms thing. If you create a form and inset this new calculated field
into it you could put a button and use the OnClick event to run your code to
send the sms.
It "may" be possible to output the field to msn messenger or skype and then
run the sms operation on load but I have never done this and not even sure
sure if you could do it.
If you can get this to work you could post the details here as I'm sure
there would be other people interest in how you get it to work.

Good luck
 
J

John W. Vinson

Details: [TableName]![CompanyNameField] &" "&[TableName]![AddressField] &"
"&[TableName]![TelephoneField] &" "&[TableName]![MachineFaultField]

minor nitpick: for table fields it's better to use . rather than ! as a
delimiter.

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks for the advice. Is there a reason for using . rather than !

It's valid SQL syntax, and ! isn't. ! is used in VBA and in forms to display
the members of a Collection (e.g. Controls on a Form, Forms in the Forms
collection). Access will actually translate the ! to a . so that JET can parse
the query correctly, but it's an extra step.

John W. Vinson [MVP]
 
J

John Adams

Wayne,

Thanks for that ideal, but I need to show the querie in on field on the
record that it relates to so I can then copy the field and paste onto my
Nokia suite and SMS it, how do I show that field on the table. You must think
I am a bit thick

Wayne-Io-M said:
Hi John

Not sure how you would sms that details. But to create a combined
(concencated) field.

Create a new query
Right click the "field" row in the 1st column.
Select build.
Insert this
Details: [TableName]![CompanyNameField] &" "&[TableName]![AddressField] &"
"&[TableName]![TelephoneField] &" "&[TableName]![MachineFaultField]

Of cource change the field and table names to what they really are.

Hope this helps

On the sms thing. If you create a form and inset this new calculated field
into it you could put a button and use the OnClick event to run your code to
send the sms.
It "may" be possible to output the field to msn messenger or skype and then
run the sms operation on load but I have never done this and not even sure
sure if you could do it.
If you can get this to work you could post the details here as I'm sure
there would be other people interest in how you get it to work.

Good luck


--
Wayne
Manchester, England.



John Adams said:
I have 4 fields which are , Company name, address, tel number, machine fault,
i need to put these together on a text field so we can 'copy & paste' them as
a field and SMS them to a person
 
J

John W. Vinson

Thanks for that ideal, but I need to show the querie in on field on the
record that it relates to so I can then copy the field and paste onto my
Nokia suite and SMS it, how do I show that field on the table. You must think
I am a bit thick

You do not need to have the field in your *table*.
You can instead have the field in a *query*, or (even better) on a *form*.

If you are interacting with your database from table datasheets, don't. That's
not their function. Table datasheets should be opened only for design or
debugging!

Follow Wayne's suggestion - create a Form with a textbox with the expression
as its Control Source. That will give you the text string that you want, on
the screen, where you can copy and past it into your Nokia software.


John W. Vinson [MVP]
 
Top