Hai Friends,
I am in the process of designing a project. On the startup screen I want a text box or a label scroll in the screen. I need help in writting code for the above.
==rajendran r
I am usually the one preaching that there is nothing that can not be done in Access if you have a little Zezt, spirit and free thinking. I really should not have given up so quickly. Inspired by ADezii I tried to go another path. I have uploaded the result as a video:
and the sample db is also attached Attachment 6853
(Saved in 2003 format, though I am unsure if the left margin property was available in 2003, so db might not open. Give it a test someone with 2003)
Just like ADezii, I made a form with a unbound textbox as wide as the form (Though it doesn't have to be). Set the timer to 100 and this code in the timer event+declaration:
Expand|Select|Wrap|Line Numbers
Private Const m_strDisplayText As String = "TheSmileyCoders scrolling text"
Private Sub Form_Timer()
Static bInit As Boolean
If Not bInit Then
Static t As TextBox
Set t = Me.tb_Scroller
t.Value = m_strDisplayText
'Set internal leftmargin to match width
t.LeftMargin = t.Width - 1
bInit = True
End If
'Lngstep is how much the margin should move per iteration
Dim lngStep As Long
lngStep = 150 'Note for a smooth appearance, match this roughly to the size of a char
'Move leftmargin until you run out of space
If t.LeftMargin - lngStep >= 1 Then
t.LeftMargin = t.LeftMargin - lngStep
Else
'Once you run out of space, eat charecters instead
I don't know of any easy way of doing this. A limited form could be a timer driven event where you move the left property of a textbox, but that would only work inside the form I believe.
If you want something more fancy (and smooth) you will need to look into API calls I think. Can't help you there.
The only scrollbar available on a TextBox control is the Vertical one. Labels have none. As Smiley says, you'll need to do something outside of the box like designing your own specific control. Possible, but very advanced, and not done in VBA I believe (so we'd be unable to help in this forum generally).
I am usually the one preaching that there is nothing that can not be done in Access if you have a little Zezt, spirit and free thinking. I really should not have given up so quickly. Inspired by ADezii I tried to go another path. I have uploaded the result as a video:
and the sample db is also attached ScrollingSplash.zip
(Saved in 2003 format, though I am unsure if the left margin property was available in 2003, so db might not open. Give it a test someone with 2003)
Just like ADezii, I made a form with a unbound textbox as wide as the form (Though it doesn't have to be). Set the timer to 100 and this code in the timer event+declaration:
Expand|Select|Wrap|Line Numbers
Private Const m_strDisplayText As String = "TheSmileyCoders scrolling text"
Private Sub Form_Timer()
Static bInit As Boolean
If Not bInit Then
Static t As TextBox
Set t = Me.tb_Scroller
t.Value = m_strDisplayText
'Set internal leftmargin to match width
t.LeftMargin = t.Width - 1
bInit = True
End If
'Lngstep is how much the margin should move per iteration
Dim lngStep As Long
lngStep = 150 'Note for a smooth appearance, match this roughly to the size of a char
'Move leftmargin until you run out of space
If t.LeftMargin - lngStep >= 1 Then
t.LeftMargin = t.LeftMargin - lngStep
Else
'Once you run out of space, eat charecters instead
@TheSmileyCoder
No problem as far as the inspirational nudge, TheSmileyCoder. I just tried to get the most effect out of the least amount of Code (LOL).
Are we talking about a control where the contents are manually scrollable (as in with a scroll-bar) or a control with automatically scrolling contents? I was thinking of the former, but if the question (which I didn't find very clear, so my interpretation may well be wrong) is about the latter then clearly there is more scope. It must be hard expressing a technical question in another language, so I'm not criticising the OP for their lack of clarity.
Thank you for handy help. Even though this has not purport the requirement, your animation works smoothly. Lot of thanks.
I have opened yr file. But i have received an error message that the database or project contains a missing or broken reference to the file "acedao.dll" version 12.0
how can i overcome this?
That would be a missing reference due to me using a newer version of access. You should be able to remove the broken reference and replace it with a newer one.
Try the following:
Open the access file
Hit Alt-F11 to open the VB editor.
Go Tools->References
You should now see a dialog box with a list of references.
I believe it is likely its the one highlight in blue that will have be missing/broken. Uncheck the reference, and find the one relevant to the version of access you are using. (There will only be one, unless you have multiple versions installed)
Sir, Thanks. I am using Access 2003 version. I could not locate the file named in your reply in the reference. However, I propose to load Access 2007 version in my system and try your code. Thank you.
I have a page (http://www.polimi.it) with a news ticker on it. I want
to have all the ticker's news read by a screen reader, which is easy
enough using the off-left trick, but also to have to...
Hi,
Say I have a text in my TEXTAREA box - 01234567890
I want - using script - insert say "abc" in the middle.
Works almost OK in Internet Explorer (with one problem) based on their
example...
In the function below I use a call to Prototype to get some text from
another webpage and I fill a div with it. You can see the red, narrow
div halfway down this page:
...
I have a program that is going to return position data several times a
second. Instead of printing this data to the screen on new line every
time, I would like to simply have the program print...
Let me start by saying that I know very little about JavaScript.
The software that I use to convert my FrameMaker files to HTML uses a
JavaScript to hide certain text. The user has to click the...
Hello,
I am trying to use UI Automation to drive an MS Windows app (with pywinauto).
I need to scrape the app's window contents and use some form of OCR to get at
the texts (pywinauto can't...
Hi everyone!
Can we get the text scrolled on the title bar of the VB Project Form? The text may be the name of the company to which I am developing the project.
Please give me answer asap!
...
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...