Solved

Numbers for Transponder Codes

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

803 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