Modify Table Input Mask

G

Guest

A project that I am currently working on requires me to modify the input mask on a table field in Access 97 through code. If anyone has a solution I would greatly appreciate it. Even though this may seem odd, I must edit the table input mask on a field at the coding level.
 
A

Allen Browne

You should be able to get to the InputMask property of the Field in the
TableDef using this kind of reference:

dbEngine(0)(0).TableDefs("MyTable").Fields("MyField").Properties("InputMask"
)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Daniel said:
A project that I am currently working on requires me to modify the input
mask on a table field in Access 97 through code. If anyone has a solution I
would greatly appreciate it. Even though this may seem odd, I must edit the
table input mask on a field at the coding level.
 
G

Guest

Allen, thank you so much for your response. I am quite impressed with the code. It does work if the field being modified resides in the current database, but my problem is that this won't work if I am trying to modify the field residing in a different access 97 database. Any thoughts on this would be greatly appreciated.

Daniel
 
T

Tim Ferguson

It does work if the field being modified resides in the current
database, but my problem is that this won't work if I am trying to
modify the field residing in a different access 97 database.

Why would you want to? The input mask is a display property only: the one
purpose of setting it on a table field is to save time when creating the
form; but changing the property in the table will not change existing form
controls. That is where you need to be setting the IM property, on the
controls on your forms, not on the table.


Hope that helps


Tim F
 
A

Allen Browne

You can OpenDatabase into the backend, and modify the property there if
necessary.

If you are not sure where the user has installed the back end, parse it from
the Connect property of the TableDef.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Daniel said:
Allen, thank you so much for your response. I am quite impressed with the
code. It does work if the field being modified resides in the current
database, but my problem is that this won't work if I am trying to modify
the field residing in a different access 97 database. Any thoughts on this
would be greatly appreciated.
 

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