Solved Autocorrect or auto complete List (1 Viewer)

Local time
Today, 06:50
Joined
Oct 31, 2021
Messages
42
Hello Everyone
I have short airports-codes
I want it autocorrect or auto complete if i write it in the filed
Example :
When I write ✍️ (R) Dxb-Par-Cai > auto complete to > : Round trip Dubai-Paris-Cairo


I have one method as photos but should be added one by one , is any idea or better solution ?
 

Attachments

  • 78B9C318-EB27-4CE1-AF17-02F27456D593.jpeg
    78B9C318-EB27-4CE1-AF17-02F27456D593.jpeg
    135.4 KB · Views: 96
  • 0000B7F7-1144-4663-907F-ED352B549707.jpeg
    0000B7F7-1144-4663-907F-ED352B549707.jpeg
    88.6 KB · Views: 102

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:50
Joined
Feb 19, 2002
Messages
43,302
The conversion is not magic. You have to create a table that converts the airport codes to a city name. Then use dLookup() to do the conversion. Include (R) in the list as Round trip and (O) as one way (if that is the code you are using).

Use InStr() to find the space character and then use split() to split the rese using - as the delimiter.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:50
Joined
May 7, 2009
Messages
19,247
you can use Combobox?
see this demo and type "(R" (without the quote) on the combobox.
 

Attachments

  • flyByMe.accdb
    640 KB · Views: 103

Saphirah

Active member
Local time
Today, 07:50
Joined
Apr 5, 2020
Messages
163
I would assume you need someting like this? Take a look at the vba code in the form.
 

Attachments

  • Autocomplete.accdb
    1.1 MB · Views: 98

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:50
Joined
Feb 19, 2002
Messages
43,302
arnel has the right idea but by putting the entire string in one combo, you will have way too many entries to manage? You will have the two city variations and the three city variations like Cairo, Athens, Dubai and Cairo, Dubai, Athens and Athens, Cairo, Dubai, and on and on and then there are the four city trips. AND all the return variations as well. My suggestion is to just make a table of the airport codes and their cities. That means you to THREE lookups to convert the string.

OR just use three combos or four and pick an airport code from each and print it out with the city names.

It is not clear where you need to use this so I just built a form to show the concept
 

Attachments

  • AirportCodeConversion.accdb
    460 KB · Views: 97
Local time
Today, 06:50
Joined
Oct 31, 2021
Messages
42
arnel has the right idea but by putting the entire string in one combo, you will have way too many entries to manage? You will have the two city variations and the three city variations like Cairo, Athens, Dubai and Cairo, Dubai, Athens and Athens, Cairo, Dubai, and on and on and then there are the four city trips. AND all the return variations as well. My suggestion is to just make a table of the airport codes and their cities. That means you to THREE lookups to convert the string.

OR just use three combos or four and pick an airport code from each and print it out with the city names.
thank you so much for your help

Screenshot_5.jpg

It is not clear where you need to use this so I just built a form to show the concept
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:50
Joined
Feb 19, 2002
Messages
43,302
Items picked from combos are not editible because you may see the text string but it is the ID field that is bound.

I can't tell what you are trying to do by the picture. Looks like you are trying to make text strings and I'm not sure why. Why would you not jus use Dated On as the caption for the data field that holds the date?
 

mike60smart

Registered User.
Local time
Today, 06:50
Joined
Aug 6, 2017
Messages
1,913
Why do you have a Form with x amount of Blank Records?

The Form looks like you have Repeating Groups ie Name 1 to Name 18, T No 1 to T No 18 etc...

Would you be able to upload your database?
 
Local time
Today, 06:50
Joined
Oct 31, 2021
Messages
42
Why do you have a Form with x amount of Blank Records?
Because this is data entry form, some invoices(record) have only one or 2 tickets
and some invoices(record) as a group that contains 15 tickets in the same invoice(record)

I am a beginner in ms accsess and i want to upgrade this database

if you have any idea to upgrade it will be great and many thanks

this my other post

https://www.access-programmers.co.uk/forums/threads/any-idea-to-upgrade-this-form.320270/

The Form looks like you have Repeating Groups ie Name 1 to Name 18, T No 1 to T No 18 etc...

Would you be able to upload your database?
sure in attachment
 

Attachments

  • LAST ONE.ZIP
    2.3 MB · Views: 106
Last edited:

mike60smart

Registered User.
Local time
Today, 06:50
Joined
Aug 6, 2017
Messages
1,913
Unable to open the attachment.
Did you have the database Open when you zipped it?
You need to close the database and then zip it.
 
Local time
Today, 06:50
Joined
Oct 31, 2021
Messages
42
Other version but without any records data
 

Attachments

  • ID Tickets-SMS.zip
    6.3 MB · Views: 111

mike60smart

Registered User.
Local time
Today, 06:50
Joined
Aug 6, 2017
Messages
1,913
Well it certainly needs a lot of work to sort out.

You have 1 table "TKT" which contains fields that need to be normalised.

Can you explain the business process for us?
 

mike60smart

Registered User.
Local time
Today, 06:50
Joined
Aug 6, 2017
Messages
1,913
I believe the attached screenshot shows a more normalised View of your Data.
 

Attachments

  • Inv.JPG
    Inv.JPG
    108 KB · Views: 96

Users who are viewing this thread

Top Bottom