If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Alter Table
Hi
How do I set the a field default value? Dim var_empid as Integer Dim var_sql as String var_empid = 34 var_sql = "ALTER TABLE Local_gl ALTER COLUMN gl_empid INTEGER DEFAULT " & var_empid DoCmd.SetWarnings False DoCmd.RunSQL var_sql DoCmd.SetWarnings True Thank you All!!! Bre-x |
#2
|
|||
|
|||
Alter Table
Not sure how you would do that in code, but you can open the table in design
mode and enter the default value in the properties. Alternatively, you could set the default value in the form's property under the data tab for the field in question. "Bre-x" wrote: Hi How do I set the a field default value? Dim var_empid as Integer Dim var_sql as String var_empid = 34 var_sql = "ALTER TABLE Local_gl ALTER COLUMN gl_empid INTEGER DEFAULT " & var_empid DoCmd.SetWarnings False DoCmd.RunSQL var_sql DoCmd.SetWarnings True Thank you All!!! Bre-x |
Thread Tools | |
Display Modes | |
|
|