473,395 Members | 1,762 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,395 software developers and data experts.

Table formatting best practices

I've heard it's best not to have any formatting specified for Table fields
(except perhaps Currency), and instead set the formatting in the Form or
Report. But what about Yes/No fields? When I create a Yes/No field in a
Table the default format is "Yes/No". If I clear or change the Format
property in the General Tab (and keep the default "Checkbox" in the Lookup
tab), the field still looks the same when I open the table in Datasheet
view.

I have all kinds of queries and code that get and set the value of these
Yes/No fields using "-1" for True and "0" for False. Does it make any
difference what the Table Format setting is? What about the Display Control
setting on the Lookup tab?

I recently experienced an unnerving error that was apparently caused by an
aberrant Yes/No field:

"Error Number 3343: Unrecognized database format
'C:\MyDirectory\MyAccess2003.mdb'.

I'm still in search of an explanation and wondering if the Table formatting
could be an issue.

Thanks in advance.
Nov 13 '05 #1
4 2685
Lookup fields obfuscate what is actually stored in the table, create
spurious indexes, and introduce other problems as discussed at:
http://www.mvps.org/access/lookupfields.htm

It is not the Display Control that causes the problems, so use it as you
wish.

Similary, the Format property of a field in the table is not evil. Not only
does it show in a query, but the controls on a new form/report inherit these
properties. If helps you then use it.

The problems I am aware of with the Format property are:
1. Don't use on Memo fields: it truncates them to 255 characters.

2. Don't use to force the display of text to upper/lower case. The data
doesn't match if you use case-sensitive searches, and users think the data
is wrong when exported.

3. Don't set to Short Date to try to hide the time component in date fields,
typically because =Now() was used as Default Value when it should have been
=Date().

4. It can make it more involved to modify a back end if you want to change
the formatting in an update of a database distributed to many locations
(i.e. where changing the front end is not enough).

AFAIK, the Format property does not contribute to corruption. For a list of
things that do, see:
Preventing Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-25.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"deko" <www.clearpointsystems.com@use_contact_form.com> wrote in message
news:sk*****************@newssvr14.news.prodigy.co m...
I've heard it's best not to have any formatting specified for Table fields
(except perhaps Currency), and instead set the formatting in the Form or
Report. But what about Yes/No fields? When I create a Yes/No field in a
Table the default format is "Yes/No". If I clear or change the Format
property in the General Tab (and keep the default "Checkbox" in the Lookup
tab), the field still looks the same when I open the table in Datasheet
view.

I have all kinds of queries and code that get and set the value of these
Yes/No fields using "-1" for True and "0" for False. Does it make any
difference what the Table Format setting is? What about the Display
Control
setting on the Lookup tab?

I recently experienced an unnerving error that was apparently caused by an
aberrant Yes/No field:

"Error Number 3343: Unrecognized database format
'C:\MyDirectory\MyAccess2003.mdb'.

I'm still in search of an explanation and wondering if the Table
formatting
could be an issue.

Thanks in advance.

Nov 13 '05 #2
> Lookup fields obfuscate what is actually stored in the table, create
spurious indexes, and introduce other problems as discussed at:
I didn't know what a Lookup field was until I read about it here:
http://support.microsoft.com/?kbid=304463

It sounds like you have to set the Display Control to Combo Box on the
Lookup tab of Field Properties when the table is in Design View. I've never
done that certialnlly don't plan to after reading about the evils of Lookup
fields!
It is not the Display Control that causes the problems, so use it as you
wish.

Similary, the Format property of a field in the table is not evil. Not only does it show in a query, but the controls on a new form/report inherit these properties. If helps you then use it.
If it doesn't matter, then I will standardize all my table fields as having
no format, and will always use "Text Box" for Display Control. This makes
Yes/No fields appear as "0" and "-1" which I think is easier to work with.
The problems I am aware of with the Format property are:
1. Don't use on Memo fields: it truncates them to 255 characters.

2. Don't use to force the display of text to upper/lower case. The data
doesn't match if you use case-sensitive searches, and users think the data
is wrong when exported.

3. Don't set to Short Date to try to hide the time component in date fields, typically because =Now() was used as Default Value when it should have been =Date().

4. It can make it more involved to modify a back end if you want to change
the formatting in an update of a database distributed to many locations
(i.e. where changing the front end is not enough).
Thanks for the heads up. With my new standard I shouldn't run into any of
these problems.
AFAIK, the Format property does not contribute to corruption. For a list of things that do, see:
Preventing Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-25.html


What I found interesting here is that you say a potential cause of
corruption is "Sharing a single mdb file amongst users". Is sharing a
single mdb really that bad? I'm wondering if opening the same mdb twice -
so there are two instances of the same database open at the same time on the
same machine - could have contributed to my "3343 Unrecognized database
format" error. Is there a way to prevent a second instance from opening on
the same machine?

Thanks for the help.
Nov 13 '05 #3
Answered embedded.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"deko" <www.clearpointsystems.com@use_contact_form.com> replied in message
news:Ux*****************@newssvr21.news.prodigy.co m...

What I found interesting here is that you say a potential cause of
corruption is "Sharing a single mdb file amongst users". Is sharing a
single mdb really that bad? I'm wondering if opening the same mdb twice -
so there are two instances of the same database open at the same time on
the
same machine - could have contributed to my "3343 Unrecognized database
format" error.
Yep: that can cause the same issue.
Is there a way to prevent a second instance from opening on
the same machine?


See:
Preventing multiple instances of a database
at:
http://www.mvps.org/access/api/api0041.htm

I don't do that personally, but you could if this is an issue for you.
Nov 13 '05 #4
> > Is there a way to prevent a second instance from opening on
the same machine?
See:
Preventing multiple instances of a database
at:
http://www.mvps.org/access/api/api0041.htm


Just for grins, I tried setting the default open mode to Exclusive in Tools Options > Advanced (before adding the function), but a second instance

still opened. In any case, that function seems to do the trick. I'm
calling it on Form_Open of the default startup form - is this the best place
to call it?

I also came across some of your recommendations at:

http://members.iinet.net.au/~allenbrowne/bug-09.html

Good stuff. I used the FixZLS function.
Nov 13 '05 #5

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

Similar topics

6
by: BT | last post by:
I'm trying to format a three column table and I can't get things to line up the way I need to. The first column is text of variable length that might wrap onto multiple lines. It is within...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
13
by: john doe | last post by:
A quick question, about so-called 'best practices', I'm interested in which of A/B of the two examples people would choose, and why. public enum MyEnum { Option1 = 0, Option2 = 1, Option3 =...
2
by: Jim Heavey | last post by:
I have an HTML table which has all kinds of special formatting and coloring and I am looking for how I should get this output to excel. I have an example working which is using the...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
1
by: serge | last post by:
I am running SQL Server Best Practices on a SQL 2000 database and it is recommending me to change the temp tables inside SPs to table variables. I had read already in other places to use table...
6
by: anirban.anirbanju | last post by:
hi there, i've some serious problem to add rows dynamically in a table. my table contains 5 cell. | check | from_value | to_value | color_text | color_value |...
3
by: John Dalberg | last post by:
I am looking for an ASP.NET application on CodePlex which exemplifies best practices for the following: - Use of interfaces - Seperation of the UI, business and data tiers - Data Tier that uses...
139
by: ravi | last post by:
Hi can anybody tell me that which ds will be best suited to implement a hash table in C/C++ thanx. in advanced
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.