Input Mask (Access 2003 SP3)

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Input Mask (Access 2003 SP3)

Post by steveh »

Morning all

I need a mask that will display a number in brackets it could be a single digit, for example (8) or it could be 2 digits seperated by a point, for example (6.1) but I cannot seem to get it right, please see screenshot, any pointers appreciated.
You do not have the required permissions to view the files attached to this post.
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
HansV
Administrator
Posts: 78446
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Input Mask (Access 2003 SP3)

Post by HansV »

Input masks in Access are rather inflexible. They can't handle multiple possible formats such as (9) and (9.9).

Can you explain why you want this format and what you want to accomplish with it? Perhaps there's an entirely different way of getting the desired end result.
Best wishes,
Hans

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Re: Input Mask (Access 2003 SP3)

Post by steveh »

HansV wrote:Input masks in Access are rather inflexible. They can't handle multiple possible formats such as (9) and (9.9).

Can you explain why you want this format and what you want to accomplish with it? Perhaps there's an entirely different way of getting the desired end result.
Hi Hans

I am trying to write a small program to complete a Dangerous Goods Shipping note (DGN), a part of the classification requires that a primary risk is always shown and this could be any number between 1 and 9 some with sub divisions such as 1.1 or 6.2 etc., it is possible that some dangerous goods may have a subsidiary risk and this must always be shown in brackets on the DGN, so for example I may have a toxic substance that is also flammable such as stabilised Acrolein so I would need to show this on the form as

UN1092, Acrolein, Stabilised, 6.1 (3), etc................

or I may have a flammable liquid that is also toxic

UN1093, Acrylonitrile, stabilised, 3 (6.1), etc............

In my original table set up I can allow for this by adding it to the original data table if there is a sub risk, should however ICAO (the governing body for DG goods) in the future classify new goods they would have to be added on the fly in the form and that is why I thought a mask would be important at design stage. Or should I perhaps, as the administrator of the database think that there would be few such changes and it would be better to add them to the table as required?

Cheers
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
HansV
Administrator
Posts: 78446
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Input Mask (Access 2003 SP3)

Post by HansV »

I'd use a field SubsidiaryRisk (or similar) in which the user simply enters 6 or 6.1.
You can then add the parentheses in a query based on the table, or in the control source of a text box on a form or report, to display the complete text in the desired format, for example:

DisplayText: [ProductCode] & ", " & [ProductDescription] & ", " & [PrimaryRisk] & IIf(Not IsNull([SubsidiaryRisk]),", (" & [SubsidiaryRisk] & ")","")
Best wishes,
Hans