Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-13-2019, 02:17 AM   #1
murray83
sega collector
 
Join Date: Mar 2017
Location: Daventry, UK
Posts: 442
Thanks: 105
Thanked 1 Time in 1 Post
murray83 is on a distinguished road
before i try my idea

question i want to ask before i dive into something.

can/could you have text box on a form update in real time when you are typing and have it dlookup to a table to translate what your typing

for example in the table would have the alphabet upper and lowercase

the form would have two text boxes one which you type in and the second which would have the dlookup which would check each character you put in the first text box and find its corresponding one in the table

or am i just chasing rainbows.

thanks all for looking

murray83 is offline   Reply With Quote
Old 03-13-2019, 02:22 AM   #2
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 6,432
Thanks: 165
Thanked 1,736 Times in 1,706 Posts
Minty is a jewel in the rough Minty is a jewel in the rough Minty is a jewel in the rough
Re: before i try my idea

Sounds like you want a "find as you type" combobox or textbox.

Something like this https://access-programmers.co.uk/for...d.php?t=273977 ?
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Minty is online now   Reply With Quote
The Following User Says Thank You to Minty For This Useful Post:
murray83 (03-13-2019)
Old 03-13-2019, 02:41 AM   #3
murray83
sega collector
 
Join Date: Mar 2017
Location: Daventry, UK
Posts: 442
Thanks: 105
Thanked 1 Time in 1 Post
murray83 is on a distinguished road
Re: before i try my idea

shall check it out, thanks for the pointer

murray83 is offline   Reply With Quote
Old 03-13-2019, 04:06 AM   #4
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,832
Thanks: 35
Thanked 556 Times in 527 Posts
MajP will become famous soon enough MajP will become famous soon enough
Re: before i try my idea

Quote:
question i want to ask before i dive into something.

can/could you have text box on a form update in real time when you are typing and have it dlookup to a table to translate what your typing

for example in the table would have the alphabet upper and lowercase

the form would have two text boxes one which you type in and the second which would have the dlookup which would check each character you put in the first text box and find its corresponding one in the table
I read this differently, like it is some kind of translation (cypher). You have a table A-Z and each record has a corresponding character or number

A X
B T
C V

If I type ABC I should see XTV. If that is correct interpretation it would be doable using the on change event of the first textbox.
MajP is online now   Reply With Quote
The Following User Says Thank You to MajP For This Useful Post:
murray83 (03-13-2019)
Old 03-13-2019, 04:35 AM   #5
murray83
sega collector
 
Join Date: Mar 2017
Location: Daventry, UK
Posts: 442
Thanks: 105
Thanked 1 Time in 1 Post
murray83 is on a distinguished road
Re: before i try my idea

Quote:
Originally Posted by MajP View Post
I read this differently, like it is some kind of translation (cypher). You have a table A-Z and each record has a corresponding character or number

A X
B T
C V

If I type ABC I should see XTV. If that is correct interpretation it would be doable using the on change event of the first textbox.
YES that is what i was after, but could it work for a whole sentence of text ??

say you typed in "hello world" and then the second text box out putted "ydool slofe"
murray83 is offline   Reply With Quote
Old 03-13-2019, 04:36 AM   #6
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,946
Thanks: 114
Thanked 2,993 Times in 2,721 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: before i try my idea

And I read it that you wanted to either change letters like a to á etc ...or translate words.
Whatever you are after, running code as each character is added can be very slow. I would use the after update event instead so your code only runs once.
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
murray83 (03-13-2019)
Old 03-13-2019, 05:38 AM   #7
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,832
Thanks: 35
Thanked 556 Times in 527 Posts
MajP will become famous soon enough MajP will become famous soon enough
Re: before i try my idea

Is this case sensitive? The solution for case sensitive will be a little more complex than non case sensitive. Does Abc need to be Xtv? If so I would not store the actual letter but the ASCII decimal value.
http://www.asciitable.com/

TblConversion
Code:
  letterOneASCII
  letterTwoASCII
then instead of
A X
B T
C V
....
a x
b t
c v

I would store

65 88
66 84
67 86
...
97 120
98 116
99 118

MajP is online now   Reply With Quote
Old 03-13-2019, 06:41 AM   #8
MajP
Newly Registered User
 
Join Date: May 2018
Location: USA baby
Posts: 1,832
Thanks: 35
Thanked 556 Times in 527 Posts
MajP will become famous soon enough MajP will become famous soon enough
Re: before i try my idea

This works for me using storing only the upper case ascii and then converting as needed for the lower. So my tblConversion looks like

Code:
convertID	ASCII_One	ASCII_Two
1	65	88
2	66	84
3	67	86
You would need to store 65-90 and its conversion.

Code:
Public Function ConvertString(myString As String) As String
  Dim I As Integer
  For I = 1 To Len(myString)
    ConvertString = ConvertString & GetLetter(Mid(myString, I, 1))
  Next I
End Function

Public Function GetLetter(Letter As String) As String
  Const TableName = "tblConversion"
  Const FldOne = "ASCII_One"
  Const FldTwo = "ASCII_Two"
  Dim IsLowerCase As Boolean
  Dim ascLetter As Long
  Dim convertASC As Long
  ascLetter = Asc(Letter)
  'Store only upper cases  lower case is between 97 and 122. Convert to upper and later convert back
  GetLetter = Letter
  If ascLetter > 96 And ascLetter < 123 Then
    IsLowerCase = True
    ascLetter = ascLetter - 32
  End If
  If ascLetter > 64 And ascLetter < 91 Then
    convertASC = DLookup(FldTwo, TableName, FldOne & " = " & ascLetter)
    If IsLowerCase Then convertASC = convertASC + 32
    GetLetter = Chr(convertASC)
  End If
End Function
here is a test

Code:
Public Sub TestIt()
  Debug.Print ConvertString("ABC abc 123 ABC")
End Sub
which prints
XTV xtv 123 XTV
Handles uppercase lower case and things not in the table.

MajP is online now   Reply With Quote
Reply

Tags
dlookup access forms , realtime , translate

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I have an idea but I have no idea where to start isapple General 7 06-26-2014 04:58 AM
Any Idea how I might... accessfleet Forms 9 01-20-2011 04:06 AM
any idea's teiben Forms 1 12-02-2004 04:47 AM
any idea's? teiben Forms 3 11-25-2004 03:28 AM
I really have no idea! jodilees Forms 2 03-10-2004 09:21 PM




All times are GMT -8. The time now is 04:14 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World