Solved

Apex True DBGrid Pro 6.0 Edit Mask Question

Posted on 2000-04-13
5
1,565 Views
Last Modified: 2012-06-27
I am using a Apex True DBGrid Pro 6.0, and in one of my columns I need to only allow the users to enter a maximum of 7 digits.  I tried using the code below:

  With dbgTransData.Columns("Case Num")
    .Width = 1100: .Caption = "Case Num": .Alignment = dbgRight
    .EditMask = "#######": .NumberFormat = "Edit Mask": .HeadAlignment = dbgCenter
  End With

The code works as far as only allowing the user to enter 7 digits but I need the default value to display as "0000000".  The code above displays a default value of "0" centered in the column.  

Any ideas on how to get what I am trying to accompish to work?
0
Comment
Question by:jasonboetcher
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:Gordonp
ID: 2711812
Cant speak for the grid your talking about, but if EditMask works the same way as the Format function then the EditMask your looking for would be

..EditMask = "0000000"

Dont know if it'll work but its worth a go.

Gordon
0
 

Author Comment

by:jasonboetcher
ID: 2711891
Didn't work Gordon.  The column data did display as "0000000" but it would not allow me to edit the data.  Thanks for the idea though.
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2711906
Never Mind Eh!
0
 
LVL 3

Accepted Solution

by:
Maxim10553 earned 25 total points
ID: 2712279
The column object has a property called Datawidth. This is of type long and defaults to 0 which imposes no size restrictions. Set this value to 7 and your problem should be solved.
0
 

Author Comment

by:jasonboetcher
ID: 2713026
Thanks!! Works great.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question