Solved

Numbers for Transponder Codes

Posted on 2004-04-01
3
781 Views
Last Modified: 2013-12-25
Hello there,

I am setting up a database in Access for eventual use in a VB6 program (if I ever get that far).

My problem is as follows;

In aviation, aircraft are assigned a 4 digit code (Transponder Code), using an octal system, that is to say only the numbers 0 thru 7 are useable, so that the numbering could follow the following sequence;

0000,0001,0002,0003,0004,0005,0006,0007
0010,0011,0012,0013,0014,0015,0016,0017,
0020,0021,0022,0023,0024,0025,0026,0027....

thru

7760,7761,7762,7763,7764,7765,7766,7767,
7770,7771,7772,7773,7774,7775,7776,7777,

This code is issued as an exclusive code (within a specified geographical area) that Air Traffic Control use to identify an aircraft on Radar Displays.

MY QUESTION IS;

How can I create a mask (in Access and later in VB6) to permit only the input of "allowed" codes?

There are some other related questions in this regard that I will post as I get to that stage.

Thank you in advance

VeeBee
0
Comment
Question by:VeeBeeSix
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 500 total points
ID: 10730872
' Form1, add textbox
Option Explicit

Private Sub Form_Load()
    Text1.MaxLength = 4 ' this can be set in properties at design time
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    ' filter keyboard input:
    ' allow control characters and digits 0-7
    If KeyAscii > 31 And Not (Chr(KeyAscii) Like "[01234567]") Then
        KeyAscii = 0
        Beep
    End If
End Sub


You can also set style of your textbox to ES_NUMBER, see http:Q_20106317.html#6012596
0
 

Author Comment

by:VeeBeeSix
ID: 10730901
OK, that worked for the VB6 part.

Is there a way to use that in Access ?

VeeBee
0
 
LVL 15

Expert Comment

by:ameba
ID: 10731054
Sorry, I don't code in Access. Maybe you can ask in Access topic area or add a 'pointer question' (20pts question saying: please see http:/VB_Databases/Q_20939693.html)

Access TA is here: http://www.experts-exchange.com/Databases/MS_Access/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need VBS version of Excel date conversion 4 65
Determine Range to Select 5 43
Passing a Text Box name to a Sub 6 79
how to know if my Checkbox is True in VB6.0? 9 41
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

862 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now