Solved

Numbers for Transponder Codes

Posted on 2004-04-01
3
803 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

856 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