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;_")
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 :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?
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.
---- LSpots keywords ?>---- HM ADS ?>
Please zip all files prior to uploading to Files section.
---- LSpots keywords ?>
SPONSORED LINKS
Microsoft access database | Microsoft access developer | Microsoft access |
Microsoft access database design | Microsoft access database training |
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.