473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Access 2003 create text based on decimal numbers

Ulv
I have a table (TblItems) with fields Lenght, Width and Height as
decimalfields. I also have the fields Desc, a text field.

In a form I have created this line of code after updating:
Desc = Lenght & " x " & Width & " x " & Height

If the values is 100, 100, 100 the result is 100 x 7920 x 100.

No matter what value I put into the width field It comes out with the
same 7920. Why??

This probably has some silly simple sollution........

May 28 '07 #1
13 2054
You should discard the Desc field! It is not needed and will become
problematic. When you need the Desc in a form or report, you should create
the expression with a formula similar to the one you show in your post.

Re: problem with your code ---
Width is a reserved word used to express the width of a control on a form or
report. The default unit of measurement is a twip which is 1/1440 of an
inch. So if you are getting 7920 twips, the width of your textbox is 5.5
inches.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


"Ulv" <la**@johs-nilsen.nowrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
>I have a table (TblItems) with fields Lenght, Width and Height as
decimalfields. I also have the fields Desc, a text field.

In a form I have created this line of code after updating:
Desc = Lenght & " x " & Width & " x " & Height

If the values is 100, 100, 100 the result is 100 x 7920 x 100.

No matter what value I put into the width field It comes out with the
same 7920. Why??

This probably has some silly simple sollution........

May 28 '07 #2
Ulv
On May 28, 3:20 pm, "Steve" <s...@private.emailaddresswrote:
You should discard the Desc field! It is not needed and will become
problematic. When you need the Desc in a form or report, you should create
the expression with a formula similar to the one you show in your post.

Re: problem with your code ---
Width is a reserved word used to express the width of a control on a form or
report. The default unit of measurement is a twip which is 1/1440 of an
inch. So if you are getting 7920 twips, the width of your textbox is 5.5
inches.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resou...@pcdatasheet.com

"Ulv" <l...@johs-nilsen.nowrote in message

news:11*********************@g4g2000hsf.googlegrou ps.com...
I have a table (TblItems) with fields Lenght, Width and Height as
decimalfields. I also have the fields Desc, a text field.
In a form I have created this line of code after updating:
Desc = Lenght & " x " & Width & " x " & Height
If the values is 100, 100, 100 the result is 100 x 7920 x 100.
No matter what value I put into the width field It comes out with the
same 7920. Why??
This probably has some silly simple sollution........- Hide quoted text -

- Show quoted text -
Thank you so much !! Re. the desc field I need it in case it will be
changed later.....

May 28 '07 #3
Re: Desc field
It is still a mistake to have the Desc field in your table!! You undoubtedly
will regret it later.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


"Ulv" <la**@johs-nilsen.nowrote in message
news:11**********************@w5g2000hsg.googlegro ups.com...
On May 28, 3:20 pm, "Steve" <s...@private.emailaddresswrote:
>You should discard the Desc field! It is not needed and will become
problematic. When you need the Desc in a form or report, you should
create
the expression with a formula similar to the one you show in your post.

Re: problem with your code ---
Width is a reserved word used to express the width of a control on a form
or
report. The default unit of measurement is a twip which is 1/1440 of an
inch. So if you are getting 7920 twips, the width of your textbox is 5.5
inches.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resou...@pcdatasheet.com

"Ulv" <l...@johs-nilsen.nowrote in message

news:11*********************@g4g2000hsf.googlegro ups.com...
>I have a table (TblItems) with fields Lenght, Width and Height as
decimalfields. I also have the fields Desc, a text field.
In a form I have created this line of code after updating:
Desc = Lenght & " x " & Width & " x " & Height
If the values is 100, 100, 100 the result is 100 x 7920 x 100.
No matter what value I put into the width field It comes out with the
same 7920. Why??
This probably has some silly simple sollution........- Hide quoted
text -

- Show quoted text -

Thank you so much !! Re. the desc field I need it in case it will be
changed later.....

May 28 '07 #4
"Ulv" <la**@johs-nilsen.nowrote in message
<11*********************@g4g2000hsf.googlegroups.c om>:
I have a table (TblItems) with fields Lenght, Width and Height as
decimalfields. I also have the fields Desc, a text field.

In a form I have created this line of code after updating:
Desc = Lenght & " x " & Width & " x " & Height

If the values is 100, 100, 100 the result is 100 x 7920 x 100.

No matter what value I put into the width field It comes out with the
same 7920. Why??

This probably has some silly simple sollution........
You might want to look at these two references with regards to your
naming convention

http://support.microsoft.com/kb/321266/EN-US/
http://support.microsoft.com/default...b;en-us;286335

as some of your names are reserved words.

For the moment, you might workaround your issues by using [brackets]

Me![Desc] = Me![Lenght] & " x " & Me![Width] & " x " & Me![Height]

But why store the value, when you can calculate/concatenate it each
time you need it?

Why you get 7920? Because you are using a reserved word as name of
something, and you don't qualify it in any way, Access picks the
width property of the current active object, which is most likely
the form. Width will then probably be the width of the form.

7920/567 -form width of 13,97 cm?

--
Roy-Vidar
May 28 '07 #5
"Steve" <so***@private.emailaddresswrote in
news:IJ*******************@newsread2.news.pas.eart hlink.net:
Re: Desc field
It is still a mistake to have the Desc field in your table!!
You undoubtedly will regret it later.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And
Word Applications
re******@pcdatasheet.com
You arrogant dumb@$$. The OP is using the calculation as a default
value for his description field. He may alter or add to the
contents thereof. It is required in any sane MRP or equivalent
system.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

May 28 '07 #6
You arrogant dumb@$$. Whoever taught you to put a calculated value in a
table? What happens if a user changes the length, width or height and
doesn't bother to change the description? It doesn't change on its own!!! In
case you are not smart enough, the result is that the description does not
match the data in the length, width and height fields!!!!!

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"Steve" <so***@private.emailaddresswrote in
news:IJ*******************@newsread2.news.pas.eart hlink.net:
>Re: Desc field
It is still a mistake to have the Desc field in your table!!
You undoubtedly will regret it later.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And
Word Applications
re******@pcdatasheet.com
You arrogant dumb@$$. The OP is using the calculation as a default
value for his description field. He may alter or add to the
contents thereof. It is required in any sane MRP or equivalent
system.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

May 28 '07 #7
You arrogant dumb@$$.

I just came across the following in the Microsoft.Public.Access. Forms
newsgoup. Do you also have the same arrogant comment about all these
responders too?

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


By OP ----- What must I do to save the total?

You must do nothing at all. It's common sense not to store values from
totals. What you do is save the 'operants' and the outcome should be
calculated as you did via a textfield or either a field in a query. When
using a query you don;t have to look in the table because you don't save the
calculation.
--
Maurice Ausum

Is there a reason you need to store the total amount in the table, though?
Can't you just calculate the total from the other fields, thereby negating
the need to redundantly store the total?

--

Ken Snell
<MS ACCESS MVP>

Generally, you should not store calculated values ... what happens if one of
the root values change, and (for some reason) the total doesn't get updated?
Since you're obviously storing the root values, just calculate the
TotalAmount when needed, using the formula you list above.

Scott McDaniel

Don't.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.

John W. Vinson [MVP]

You have received a lot of good advice. Pay particular attention to Johm
Vinson. His comment pretty much covers it.
------
Dave Hargis, Microsoft Access MVP
Thanks to you all.

I will not save the total.
I will not save the total.
I will not save the total.

Seriously, I appreciate all your input.

By OP ------



"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"Steve" <so***@private.emailaddresswrote in
news:IJ*******************@newsread2.news.pas.eart hlink.net:
>Re: Desc field
It is still a mistake to have the Desc field in your table!!
You undoubtedly will regret it later.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And
Word Applications
re******@pcdatasheet.com
You arrogant dumb@$$. The OP is using the calculation as a default
value for his description field. He may alter or add to the
contents thereof. It is required in any sane MRP or equivalent
system.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

May 28 '07 #8
"Steve" <so***@private.emailaddresswrote
You arrogant dumb@$$. Whoever taught you
to put a calculated value in a table? What happens
if a user changes the length, width or height and
doesn't bother to change the description? It doesn't
change on its own!!! In case you are not smart
enough, the result is that the description does not
match the data in the length, width and height fields!!!!!
Steve, you perhaps should read a full discussion on "calculated fields in
tables". There are cases, such as a calculated cost, in which the factors
may change, but the cost is set and stays the same. The way it goes is, "any
calculation which can be reproduced when needed should not be stored in the
table."

From the posts I see, there's not enough information about the situation for
either you or Bob to make the strong statements you've each made, as though
they were fact. And, whether or not your descriptions of each other are
accurate, I'd personally appreciate it if you would control your emotions
and reduce the nastiness.

Larry Linson

May 29 '07 #9
"Bob Quintal" <rq******@sPAmpatico.cawrote
You arrogant dumb@$$. The OP is using the calculation as a default
value for his description field. He may alter or add to the
contents thereof. It is required in any sane MRP or equivalent
system.
Bob, "any calculation which can be reproduced when needed should not be
stored in the table." From the posts I see, there's not enough information
about the situation for either you or Steve to make the strong statements
you've each made, as though they were fact. And, whether or not your
descriptions of each other are accurate, I'd personally appreciate it if you
would control your emotions and reduce the nastiness.

Larry Linson
May 29 '07 #10
Bob, "any calculation which can be reproduced when needed should not be
stored in the table." From the posts I see, there's not enough information
about the situation for either you or Steve to make the strong statements
you've each made, as though they were fact. And, whether or not your
descriptions of each other are accurate, I'd personally appreciate it if you
would control your emotions and reduce the nastiness.

Larry Linson
Hi Larry,

Nastiness is 'in the air' starting from the very moment that Steve is 'back'.
It is very nasty and disappointing to see him advertising again.
In fact it is a bloody shame !!
I do hope we can reduce the nastiness indeed.

Arno R
May 29 '07 #11
Ulv
On May 29, 9:03 am, "Arno R" <arracomn_o_s_p_...@planet.nlwrote:
Bob, "any calculation which can be reproduced when needed should not be
stored in the table." From the posts I see, there's not enough information
about the situation for either you or Steve to make the strong statements
you've each made, as though they were fact. And, whether or not your
descriptions of each other are accurate, I'd personally appreciate it if you
would control your emotions and reduce the nastiness.
Larry Linson

Hi Larry,

Nastiness is 'in the air' starting from the very moment that Steve is 'back'.
It is very nasty and disappointing to see him advertising again.
In fact it is a bloody shame !!
I do hope we can reduce the nastiness indeed.

Arno R
Ok, Thanks for all answers. I'm pretty new to this.
I need both the original sizes and the changed sizes.
I will then compare and see how much has been given away (as a
discount).

Regarding the discription I just really want the user to be able to
enter whatever he wants. But by default according to sizes.

L


May 29 '07 #12
"Larry Linson" <bo*****@localhost.notwrote in
news:PSK6i.644$d63.283@trnddc06:
"Bob Quintal" <rq******@sPAmpatico.cawrote
>You arrogant dumb@$$. The OP is using the calculation as a
default value for his description field. He may alter or add
to the contents thereof. It is required in any sane MRP or
equivalent system.

Bob, "any calculation which can be reproduced when needed
should not be stored in the table." From the posts I see,
there's not enough information about the situation for either
you or Steve to make the strong statements you've each made,
as though they were fact. And, whether or not your
descriptions of each other are accurate, I'd personally
appreciate it if you would control your emotions and reduce
the nastiness.

Larry Linson
Hi Larry, I will agree that a true calculated value (the sum of
po line values, e.g.) should always be calculated, but a desc
(ription) field, as the original poster named the target of his
calculation, is one of the places where the rule should never
apply.

I've worked MRP systems long enough to know that not all entries
will obey the rule, and that when you have 24 entries for a
material that is 4ft x 8ft x 1/2in you are going to want to add
other words to that description, like plywood, particle board,
gypsum board....Populating part of a description field from
other data entities is a wise way of automating the data entry
task..
..

Besides, there are good reasons to "denormalize" a table.
http://fox.wikis.com/wc.dll?
Wiki~SpecificReasonsToDenormalize~SoftwareEng
http://safari.oreilly.com/078972569X/ch04lev1sec3

I would not even classify this instance as a denormalization.

As to PCD (Pretty Crappy Developer) posting his supercilious and
often misleading suggestions, along with his blatantly violating
the rule of "No Advertizing" with his tagline, I asked him
before to "Go Away, don't go away mad, just go away.". He was
gone for a long while, and things were peaceful. He comes back,
and in the first two responses here, he gives wrong answers. At
least he's consistent.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

May 29 '07 #13
"Steve" <so***@private.emailaddresswrote in message
news:IJ*******************@newsread2.news.pas.eart hlink.net...
Re: Desc field
It is still a mistake to have the Desc field in your table!! You
undoubtedly will regret it later.
My take on this is that the OP wants the calculated value to be the default
description which the user can then edit if they wish.

Keith.

May 30 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Stan Brown | last post by:
http://www.acad.sunytccc.edu/instruct/sbrown/stat04/qz05_.htm A table comes near the beginning of the page. I have the <td> of row 1 column 1 styled in line with border-top:none and...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: Giulio | last post by:
I make an import of a huge file txt table with headers at each page and date format as "20.12.2004" in order to use the data I first qo a query that exclude all line representing the headers...
4
by: hi | last post by:
I'm having major problem with multiplications in querys. E.g. Table 1 f1 Single f2 Single f1=1.12 f2=.2345 I create a query with just one field a:f1*f2 and I get
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
13
by: evancater | last post by:
My client wants to make their Access 2007 database available to offices around the country with multi-user permissions set to control access to the tables and forms, etc. The easiest thing would be...
1
by: Warren Thai | last post by:
I am using Access 2003. I need to export data from a query to a .txt file. I know how to do this but however there is a problem with my data being rounded. The numbers in the data have 3 decimal...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.