Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Formula to Table field 1

Status
Not open for further replies.

JustineB

Programmer
Mar 30, 2001
165
GB
I have a table which holds 1000's of Product Codes. Each Product code can be split down into 4 Product Types.
I have a formula on an unbound control on a form which looks at the first letter of the Product Code and then assigns the Product Type.

I need to add this field to the Product Table as I need to use it in queries, reports etc, but I simply cannot work out how to do it.

It may be that I am missing something really simple, but would appreciate some help. If I need to change the way that this whole Product Type field works, that would be fine too.

Many thanks in advance.

Justine.
 
A few ways this can be done.

Can you add the left([field],1) function to the quieries you are creating? This is the easiest option.

To add to it the table, you need a field in the table to hold this letter. When you have this, you use an update query. This will place into the new field the result of left([field],1). I suggest you put in the query as check to ensure that the new field is blank (so that when run in future you don't waste time updating records that are already updated).

[pc]

Graham
 
Great!

Thanks for the suggestions - I'll get on and try them and let you know how I get on.

Justine
 
Dear Graham

Thank very much - your idea about the Update query has pushed me towards what I am looking for. I can now use the field in a report and use it as a parameter - which is what I needed!

Many thanks
Justine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top