Alter Table

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
 
S

SuzyQ

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top