Display text on a form random in a specific time range (1 Viewer)

Tiprof

Member
Local time
Today, 10:11
Joined
Apr 29, 2022
Messages
43
I have a database that displays text on a form when the form is loaded. It has a table that contains all the text to be displayed on the form.
I will like the text to change by itself in a particular time. Say, after every 5 minutes, the text should randomly change to a new one on the form.

Below is a sample of my database for analysis
 

Attachments

  • MY DATABASE.accdb
    832 KB · Views: 66

theDBguy

I’m here to help
Staff member
Local time
Today, 03:11
Joined
Oct 29, 2018
Messages
21,498
You can use the Timer event in conjunction with the Timer Interval property to display a different text on your form.
 

Tiprof

Member
Local time
Today, 10:11
Joined
Apr 29, 2022
Messages
43
You can use the Timer event in conjunction with the Timer Interval property to display a different text on your form.
I added the code to the timer
But it didn’t work
That’s why I had to post it here for suggestions
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:11
Joined
Oct 29, 2018
Messages
21,498
I added the code to the timer
But it didn’t work
That’s why I had to post it here for suggestions
I'll take a look. What does "didn't work" mean? Did you get an error message?
 

Tiprof

Member
Local time
Today, 10:11
Joined
Apr 29, 2022
Messages
43
I'll take a look. What does "didn't work" mean? Did you get an error message?
It didn’t update after a period of time
It just displays the first text and that still remains
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:11
Joined
Oct 29, 2018
Messages
21,498
It didn’t update after a period of time
It just displays the first text and that still remains
I see. That's because you don't have the code to change the text in the Timer event. I see you already have a timer to scroll the headers. How often do you want to see the text change?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:11
Joined
Oct 29, 2018
Messages
21,498
For now, I modified your db to show a different text every 2 seconds, just to demonstrate...
 

Attachments

  • MY DATABASE.zip
    39.2 KB · Views: 76
Last edited:

Tiprof

Member
Local time
Today, 10:11
Joined
Apr 29, 2022
Messages
43
For now, I modified your db to show a different text every 2 seconds, just to demonstrate...
Your code worked perfectly.
I didn’t change anything except the time which I changed to 45 seconds.

Thanks so much for your efforts and time
I really appreciate
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:11
Joined
Oct 29, 2018
Messages
21,498
Your code worked perfectly.
I didn’t change anything except the time which I changed to 45 seconds.

Thanks so much for your efforts and time
I really appreciate
Glad to hear it worked for you. Good luck with your project.
 

Users who are viewing this thread

Top Bottom