![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |