Alter Table

  • Thread starter Thread starter Bre-x
  • Start date Start date
B

Bre-x

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
 
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.
 
Back
Top