You can set the input mask via the property.  The tricky thing about DAO field properties is that they don't exist inherently, you have to create them.  In the bit of code below, I'm creating a table to test this, but you'd just replace this with your ALTER statement.
 
'***** code start *****'
 
    Dim db As DAO.Database
    Dim td As DAO.TableDef
    Dim fld As DAO.Field
   
    Set db = CurrentDb
   
    db.Execute "CREATE TABLE tblTestMask (TestField Text(8))"
   
    db.TableDefs.Refresh
    Set td = db.TableDefs("tblTestMask")
    Set fld = td.Fields("TestField")
    fld.Properties.Append fld.CreateProperty("InputMask", dbText, "99/99/0000;0;_")
 
'***** code end *****'
 

Tom Oakes
Personal PC Consultants, Inc.
[EMAIL PROTECTED]
503.230.0911 (O)
402.968.6946 (C)
713.583.7091 (F)


 

From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of verly yuli
Sent: Monday, July 11, 2005 6:40 PM
To: AccessDevelopers@yahoogroups.com; accessvbacentral@yahoogroups.com
Subject: [AccessDevelopers] could i create input mask a field with code?

i have a example code :

    Set db =
DBEngine.OpenDatabase("C:\MyDatabase.mdb")
    db.Execute "ALTER TABLE tblbpsp ADD COLUMN
kodekonsumen text(5)"

it is true?
and could i add a input mask on field kodekonsumen?

thank you


regards

verly yuli



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



Please zip all files prior to uploading to Files section.





Please zip all files prior to uploading to Files section.




SPONSORED LINKS
Microsoft access database Microsoft access developer Microsoft access
Microsoft access database design Microsoft access database training


YAHOO! GROUPS LINKS




Reply via email to