Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change input mask in DB via code?

Status
Not open for further replies.

Gwena

Programmer
Mar 11, 2004
42
IL
Hi there,
Is there a way to change via code the input task of a field in a giving table?
Thanx
Gwen
 
Yes, but it may be more suitable to use a form and change the input mask for that.

Code:
Dim tdf As DAO.TableDef
Dim fld As Field
Set DB = CurrentDb
Set tdf = DB.TableDefs("Table1")
'Debug.Print tdf.Fields("Field1").Properties("InputMask")
tdf.Fields("Field1").Properties("InputMask") = 101
'Debug.Print tdf.Fields("Field1").Properties("InputMask")

Not all field types have an Input Mask property, if you try to set an Input Mask for such a field, you will get an error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top