Hi Kevin,
it is good to save the value returned by InputBox to a string and test to determine what to do
'~~~~~~~~~~~~~~~~~~~
Dim sInput As String _
, sValue as string
sInput = InputBox("MyMessage")
If sInput <> "" Then 'user didn't Cancel
'get first character
sValue = left(sInput,1)
End If
'~~~~~~~~~~~~~~~~~~~
WHERE:
sValue is the first character
have an awesome day,
crystal
free code you can use in your projects
https://msaccessgurus.com/code.htm
Hi Kevin
The following code shows the two first letters of LBNR, which has the format AB1234:
Me.Image12.Picture = strSAMLINGdrev & Left([LBNR], 2) & "\" & [LBNR] & ".jpg"
Where strSAMLINGdrev is as path so the picture shown will be e.g. D:\RODS\SAMLING\AB\AB1234.jpg
Does it work for you?
PeterDen 16-01-2019 kl. 16:22 skrev Qingqing qingqinga@yahoo.com [MS_Access_Professionals]:
Dear All,
How do we get the first letter of an inputbox? For example, if I type "a123", how the I get the "a"? Thanks.
Best Regards,
Kevin
Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
Tidak ada komentar:
Posting Komentar