Solved

Numbers for Transponder Codes

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now