473,602 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change Input mask in code

I have a db with Access front end, sql back, linked tables. I need to be
able to change input masks at the table level in code.

Any ideas?
Thanks!
Nov 13 '05 #1
7 7038
Michael Miller,
Input masks are part of the UI for Access and not commonly supported by
client-server database management systems. You could try writing a stored
procedure in SQL Server to do what you want.
--
Alan Webb
kn*******@SPAMh otmail.com
"It's not IT, it's IS
"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I have a db with Access front end, sql back, linked tables. I need to be
able to change input masks at the table level in code.

Any ideas?
Thanks!

Nov 13 '05 #2
I realize that. That's what I am trying to change.

For example, I store a phone # in the sql table as a 10 digit string. I
want to be able to manipulate the input mask property on the linked table in
Access. This is purely an Access issue.
"Alan Webb" <kn*******@hotS PAMmail.com> wrote in message
news:GJ******** ************@co mcast.com...
Michael Miller,
Input masks are part of the UI for Access and not commonly supported by
client-server database management systems. You could try writing a stored
procedure in SQL Server to do what you want.
--
Alan Webb
kn*******@SPAMh otmail.com
"It's not IT, it's IS
"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I have a db with Access front end, sql back, linked tables. I need to be
able to change input masks at the table level in code.

Any ideas?
Thanks!


Nov 13 '05 #3

"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I realize that. That's what I am trying to change.

For example, I store a phone # in the sql table as a 10 digit string. I
want to be able to manipulate the input mask property on the linked table in Access. This is purely an Access issue.


It does not sound "purely an Access issue" to me, if you want to manipulate
the Input Mask at the table level, and the server DB does not support Input
Masks at the table level. Consider using the Input Mask property of the
Control where you display/edit the data, if you want it to be purely an
Access issue.

That said, Input Masks are rather inflexible and my users have always
thought they were a hindrance rather than a help -- we used them, primarily,
to satisfy Y2K standards, and otherwise handled the needed functionality in
validation rules and validation code. YMMV.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #4
Access already allows me to set an input mask at the table level on a linked
sql table, independent of the server db. Access just changes how the data
is displayed.

I need to do this at the table level so that I don't ahve to worry about how
the data is displayed on any form that might be created. I'm trying to
build a generic db that I can copy, and then just change the table
references from the model to the actual sql db. Unfortunately, the input
masks don't make the trip. If I can't change the input masks at the table
level, I need to do it on each form.

"Larry Linson" <bo*****@localh ost.not> wrote in message
news:tjdge.2317 3$hh6.2364@trnd dc01...

"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I realize that. That's what I am trying to change.

For example, I store a phone # in the sql table as a 10 digit string. I
want to be able to manipulate the input mask property on the linked table

in
Access. This is purely an Access issue.


It does not sound "purely an Access issue" to me, if you want to
manipulate
the Input Mask at the table level, and the server DB does not support
Input
Masks at the table level. Consider using the Input Mask property of the
Control where you display/edit the data, if you want it to be purely an
Access issue.

That said, Input Masks are rather inflexible and my users have always
thought they were a hindrance rather than a help -- we used them,
primarily,
to satisfy Y2K standards, and otherwise handled the needed functionality
in
validation rules and validation code. YMMV.

Larry Linson
Microsoft Access MVP

Nov 13 '05 #5
F. Michael Miller,
If you had a check constraint which refused to insert rows because a value
in the row didn't match an input mask and the process attempting to insert a
row was code and not a human then any row that violated the constraint would
not make it into the table. Now the problem is you have less data in the
destination than you should and there has to be a follow-on bit of work to
evaluate the rows that didn't insert and decide what to do. All in a day's
work for a DBA but I for one would rather have crappy data I can analyze and
address what's crappy than less than expected or no data in my destination.
For example, if only some of the line items on an invoice make it into my
table to calculate commissions for variable pay then a bunch of my sales
people are going to have smaller than expected paychecks and I will be
famous in way's I'd rather avoid.

Access bends the rules and allows you to do things that other dbms software
doesn't support. As I suggested in another post, if you must have this then
a check constraint tied to a stored procedure is your best option.
--
Alan Webb
kn*******@SPAMh otmail.com
"It's not IT, it's IS"

"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
Access already allows me to set an input mask at the table level on a
linked sql table, independent of the server db. Access just changes how
the data is displayed.

I need to do this at the table level so that I don't ahve to worry about
how the data is displayed on any form that might be created. I'm trying
to build a generic db that I can copy, and then just change the table
references from the model to the actual sql db. Unfortunately, the input
masks don't make the trip. If I can't change the input masks at the table
level, I need to do it on each form.

"Larry Linson" <bo*****@localh ost.not> wrote in message
news:tjdge.2317 3$hh6.2364@trnd dc01...

"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I realize that. That's what I am trying to change.

For example, I store a phone # in the sql table as a 10 digit string. I
want to be able to manipulate the input mask property on the linked
table

in
Access. This is purely an Access issue.


It does not sound "purely an Access issue" to me, if you want to
manipulate
the Input Mask at the table level, and the server DB does not support
Input
Masks at the table level. Consider using the Input Mask property of the
Control where you display/edit the data, if you want it to be purely an
Access issue.

That said, Input Masks are rather inflexible and my users have always
thought they were a hindrance rather than a help -- we used them,
primarily,
to satisfy Y2K standards, and otherwise handled the needed functionality
in
validation rules and validation code. YMMV.

Larry Linson
Microsoft Access MVP


Nov 13 '05 #6
Found it:

Sub SetProperties()

Dim fld As DAO.Field

Dim dbs As DAO.Database

Dim tdf As DAO.TableDef

Set dbs = CurrentDb

Set tdf = dbs.TableDefs(" YourTableName")

Set fld = tdf.Fields("Dat eAdded")

fld.Properties. Append fld.CreatePrope rty("InputMask" , dbText,
"99/99/0000;0;_")

Set fld = tdf.Fields("Add ress1")

fld.Properties. Append fld.CreatePrope rty("InputMask" , dbText, ">")

Set fld = Nothing

Set tdf = Nothing

Set dbs = Nothing

End Sub



"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I have a db with Access front end, sql back, linked tables. I need to be
able to change input masks at the table level in code.

Any ideas?
Thanks!

Nov 13 '05 #7
If you new anything about the business rules I'm implementing, perhaps you'd
have a point, but you don't.


"Alan Webb" <kn*******@hotS PAMmail.com> wrote in message
news:YO******** ************@co mcast.com...
F. Michael Miller,
If you had a check constraint which refused to insert rows because a value
in the row didn't match an input mask and the process attempting to insert
a row was code and not a human then any row that violated the constraint
would not make it into the table. Now the problem is you have less data
in the destination than you should and there has to be a follow-on bit of
work to evaluate the rows that didn't insert and decide what to do. All
in a day's work for a DBA but I for one would rather have crappy data I
can analyze and address what's crappy than less than expected or no data
in my destination. For example, if only some of the line items on an
invoice make it into my table to calculate commissions for variable pay
then a bunch of my sales people are going to have smaller than expected
paychecks and I will be famous in way's I'd rather avoid.

Access bends the rules and allows you to do things that other dbms
software doesn't support. As I suggested in another post, if you must
have this then a check constraint tied to a stored procedure is your best
option.
--
Alan Webb
kn*******@SPAMh otmail.com
"It's not IT, it's IS"

"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
Access already allows me to set an input mask at the table level on a
linked sql table, independent of the server db. Access just changes how
the data is displayed.

I need to do this at the table level so that I don't ahve to worry about
how the data is displayed on any form that might be created. I'm trying
to build a generic db that I can copy, and then just change the table
references from the model to the actual sql db. Unfortunately, the input
masks don't make the trip. If I can't change the input masks at the
table level, I need to do it on each form.

"Larry Linson" <bo*****@localh ost.not> wrote in message
news:tjdge.2317 3$hh6.2364@trnd dc01...

"F. Michael Miller" <fm***@netzero. net> wrote in message
news:11******** *****@corp.supe rnews.com...
I realize that. That's what I am trying to change.

For example, I store a phone # in the sql table as a 10 digit string.
I
want to be able to manipulate the input mask property on the linked
table
in
Access. This is purely an Access issue.

It does not sound "purely an Access issue" to me, if you want to
manipulate
the Input Mask at the table level, and the server DB does not support
Input
Masks at the table level. Consider using the Input Mask property of the
Control where you display/edit the data, if you want it to be purely an
Access issue.

That said, Input Masks are rather inflexible and my users have always
thought they were a hindrance rather than a help -- we used them,
primarily,
to satisfy Y2K standards, and otherwise handled the needed functionality
in
validation rules and validation code. YMMV.

Larry Linson
Microsoft Access MVP



Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
12699
by: dude | last post by:
hello how would i make an input mask that only makes the first letter a capitol one? i've been playing around and testing various masks, also tried the wizard, but i've had no luck. could anyone help, many thanks in advance.
2
2873
by: Ellen Manning | last post by:
I've got an A2K database with a link to a table in another A2K database. This linked table contains SSN formatted with the SSN input mask. I'm trying to use a dlookup using this linked table. The criteria is matching this linked SSN with an SSN that the user will input. I have an input mask on the SSN field (on the form only) but the dlookup is not working. I've tried the following 2 criterias: strCriteria = conQuote & _...
1
6316
by: Miranda Evans | last post by:
In my application, a text box control resides in a form. The text box control is unbound, but--assuming all edits are passed when the user click a command button on the form--the contents of the text box control end up in a field in a table with a data type of Date/Time. Is it possible to set up a mask on this text box control such that if one types any any of the following sequence of characters into the text box 06/25/04 6/25/04
9
2945
by: Paul | last post by:
hi, is there an input mask i could use on a report to do the following: (1) if i enter "THISISATEST" on my form, i want the text box on my report to display: "T H I S I S A T E S T". (2) if i enter "THIS IS A TEST" on my form, i want the text box on my report to display: "T H I S I S A T E S T".
11
4423
by: MS | last post by:
The simplest input mask for peoples names is.... >L<?????????????? But what about when you have names like MacDonald, or Mary-Anne? Anyone come up with a good "all round" "idiots" mask that still applies capitals and lower case when required - even for Mac and hyphens?
3
3323
by: AA Arens | last post by:
When I want the first character of a field to be Uppercased, I need to make an input mask, like >L< followed by ??????? for example. But this mask creates ____ in an unfilled field, which I don't like. How to get the fist character uppercased without an input mask or without ____ (underscores). When I click with the mouse on an empty field, it won't go to the far left side, cause of the input mask. How to avoid it? Bart
9
11485
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox? Or can I use for mask input some other control?
7
7687
by: Vlad | last post by:
I have a problem of different date formats in an international study, where the data entry module and error checking module are delivered to the data collecting centres. Error checking module displays queries for edit specifications, many of them with dates. For exmple in Sweden, date format is YYYY-MM-DD, this are how dates are displayed; However, the input mask had been specified for tables as dd/mm/YYYY. This makes problematic using...
7
3497
desklamp
by: desklamp | last post by:
I'm a total Access newbie, please bear with me! Using Win2K/Access 2003. I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no native way of converting an IP address to an integer/long number (which is much more efficient to index and search). After searching, I found a function which is able to take either an IP address or integer and convert it to the other. In the...
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.