473,698 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reformatting fields in a table

last month I started on changing the format in a LOT of tables.

changing Long Integer and Singles to double.

I got that working but I have one more question..
Sub AlterFieldType( TblName As String, FieldName As String, DataType
As
_
String, Optional Size As Variant)
Dim cd
If IsMissing(Size) Then
DoCmd.RunSQL "ALTER TABLE [" & TblName & "] ALTER COLUMN [" &
FieldName & _
"] " & DataType
Else
DoCmd.RunSQL "ALTER TABLE [" & TblName & "] ALTER COLUMN [" &
FieldName & _
"] " & DataType & "(" & Size & ")"
End If
End Sub

AlterFieldType "tblTEST", "test", "Single"

it worked nicely

and all was well but now they want to change one more thing and I am
not sure how.

most of these variables are set Single with format = fixed
and decimal places being 1,2 or 3

can these be removed like a new variable.

they dont' want any formatting on these numbers and want everything
set to double.

the double is no problem but I can not find the syntax for the other
things.

Nov 27 '07 #1
2 1719
Can I just do this by changing the property ?

On Tue, 27 Nov 2007 17:18:40 GMT, sparks <js******@swbel l.netwrote:
>last month I started on changing the format in a LOT of tables.

changing Long Integer and Singles to double.

I got that working but I have one more question..
Sub AlterFieldType( TblName As String, FieldName As String, DataType
As
_
String, Optional Size As Variant)
Dim cd
If IsMissing(Size) Then
DoCmd.RunSQL "ALTER TABLE [" & TblName & "] ALTER COLUMN [" &
FieldName & _
"] " & DataType
Else
DoCmd.RunSQL "ALTER TABLE [" & TblName & "] ALTER COLUMN [" &
FieldName & _
"] " & DataType & "(" & Size & ")"
End If
End Sub

AlterFieldType "tblTEST", "test", "Single"

it worked nicely

and all was well but now they want to change one more thing and I am
not sure how.

most of these variables are set Single with format = fixed
and decimal places being 1,2 or 3

can these be removed like a new variable.

they dont' want any formatting on these numbers and want everything
set to double.

the double is no problem but I can not find the syntax for the other
things.
Nov 27 '07 #2
Well almost got it.

For Each prp In fld.Properties
' Debug.Print prp.Name & " === " & prp.Type

If FieldTypeName(f ld) = "Long Integer" Or
FieldTypeName(f ld) = "Single" Then
'Debug.Print FieldTypeName(f ld) & " FOUND"
If prp.Name = "Format" Then prp.Value =
"General Number"
if I use prp.value = " " this removes the formatting but
it will not take General Number even though I can print it and it
shows General Number if I format it in the table as such.

any ideas?

On Tue, 27 Nov 2007 17:18:40 GMT, sparks <js******@swbel l.netwrote:
>last month I started on changing the format in a LOT of tables.

changing Long Integer and Singles to double.

I got that working but I have one more question..
Sub AlterFieldType( TblName As String, FieldName As String, DataType
As
_
String, Optional Size As Variant)
Dim cd
If IsMissing(Size) Then
DoCmd.RunSQL "ALTER TABLE [" & TblName & "] ALTER COLUMN [" &
FieldName & _
"] " & DataType
Else
DoCmd.RunSQL "ALTER TABLE [" & TblName & "] ALTER COLUMN [" &
FieldName & _
"] " & DataType & "(" & Size & ")"
End If
End Sub

AlterFieldType "tblTEST", "test", "Single"

it worked nicely

and all was well but now they want to change one more thing and I am
not sure how.

most of these variables are set Single with format = fixed
and decimal places being 1,2 or 3

can these be removed like a new variable.

they dont' want any formatting on these numbers and want everything
set to double.

the double is no problem but I can not find the syntax for the other
things.
Nov 27 '07 #3

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

Similar topics

21
6546
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to reformatting my system. Prior to the reformatting, I copied the help.rtf file onto a CD and checked the box to...
0
1087
by: Draz | last post by:
I have some XML extended language that generates output. Everything works ok. I have created additional xsl templates for reformatting strings, mathematical calculations and reformatting numbers. It also works ok. Finally, I'm missing one step. I need to put all these results as values closed in quotes, everything in one line. Example input is:
5
2418
by: rettigcd | last post by:
I am using Access 2000. I have a query that I enter in sql that performs a left join: SELECT person.*,phone.* FROM person LEFT JOIN phone ON ((phone.person_id=person.person_id) AND (phone.type='home'));
7
1616
by: David Jacques | last post by:
I have to reformat a string from the form "SRID=4269;POINT(-90.673 69.4310000006199)" to GeometryFromText('POINT (-141.095 68.5430000006417)',4269) ); I have a function to do this by taking the input string as char* and returning
3
1373
by: Chris Lane | last post by:
Hi, This is super annoying FrontPage like behavior. Does anybody know how I can stop the Visual Studio.NET IDE from reformatting my HTML? Thank You
7
1240
by: Lloyd Sheen | last post by:
I know I have seen a way to stop the terrible reformatting that VS 2003 IDE does. Beyond that is MS going to do a better (could not do a worse) job of auto formatting. Every change I make to the format of the page causes reformatting which totally gets rid of the idea that controls are nested and have some structure. Please help
6
2177
by: Abhishek Srivastava | last post by:
Hello All, I am developing a page which has a complex layout. This layout cannot be made using VS alone, so I have to go into the html view and edit the html myself. The problem is that everytime I save the file, (or add/remove any component to the page) VS.Net reformats and re-edits the whole page. I find this very irrating because VS.Net totally disorganizes my code.
3
1571
by: GrantMagic | last post by:
Appologies if this is a wrong newgroup for this question, but i can't find a visualstudio newgroup (at least not an english one, their is a french and arabic one) Anyways, i have a highly annoying problem with visual studio. Every time i add a new control to the page, visual studio decides to format my code in its "special format". So i have code that looks like this:
482
27699
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly. Currently this is what it does serial information 1 parts 1
0
8678
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.