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: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of verly yuli
Sent: Monday, July 11, 2005 6:40 PM
To: [email protected]; [email protected]
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. 



  _____  

YAHOO! GROUPS LINKS 


        
*        Visit your group "AccessDevelopers
<http://groups.yahoo.com/group/AccessDevelopers> " on the web.
  

*        To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
  

*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> . 


  _____  




[Non-text portions of this message have been removed]





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessVBACentral/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to