Help With Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm looking to insert a bar on a form which shall have information moving
along it (a bit like what you get on news channels)

Can anyone help with this as I don't know what term to use when searching in
the help section?

Thanks,
Chris
 
Hi,

I'm looking to insert a bar on a form which shall have information moving
along it (a bit like what you get on news channels)

Can anyone help with this as I don't know what term to use when searching in
the help section?

Thanks,
Chris

You can add a label with a moving display to a form like this.

Add a label.
Set it's Caption to a space.
Set the Label's TextAlign property to Right.
Size the label to a one line height, as wide as you wish it.

Set the Form's Timer interval to 500 (for a one half second interval
scroll).

Code the form's Timer event:

Private Sub Form_Timer()
Dim strMsg As String
Static I As Integer
I = I + 1
strMsg = "Your message here "
If I > Len(strMsg) Then I = 1
LabelName.Caption = LabelName.Caption & Mid(strMsg, I, 1)
End Sub

The message will continuously scroll.
 
Hi Fred,

Thanks for this, being new to access could you tell me how to code the
form's timer event?

Thanks,
Chris
 
Hi Fred,

Thanks for this, being new to access could you tell me how to code the
form's timer event?

Thanks,
Chris

Display the Form's property sheet (in Design View.
Click on the Event tab.
On the line thas says On Timer write:
[Event Procedure]
Then click on the little button with the 3 dots that appears on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:

Dim strMsg As String
Static I As Integer
I = I + 1
strMsg = "Your message here "
If I > Len(strMsg) Then I = 1
LabelName.Caption = LabelName.Caption & Mid(strMsg, I, 1)
End If

(note: my original reply left off this End If line. Sorry.)

Save the code.
Remember to also set the Form's Timer Interval to 500 (or whatever
value you wish. 1000 = 1 second.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top