View Single Post
  #2  
Old January 15th, 2005, 06:05 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Sat, 15 Jan 2005 07:35:18 -0800, Gina wrote:

I would like to make a form that docks to the bottom of my
screen and has a display of information - idealy as
a "ticker tape" streaming right to left, but it could also
just be a constant message.

How do I make it "dock" to the bottom?

How do I make it stream the message?


You can create a form with a moving message like this.
Create a new form. Name it "frmRollMessage".
Navigation buttons No.
Divider Lines No.
Scroll Bars No.
Set it's Pop-Up property to Yes.

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.
Size the form to just fit around the label.

Set the form Border property to either Thin or None.
If you set it to thin, it will include the caption bar as well as the
close button. The user will not be able to resize it but will be able
to move it.
If you set it to none, the user will not be able to resize, move, or
close it. You will need code elsewhere to close the form. (See my
example code below.)

Code it's Load event:
DoCmd.MoveSize X * 1440, Y * 1440
(where X is how many inches from the left and Y is how many inches
down from the top positions the form where you want 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 = "Some message here "

If I Len(strMsg) Then I = 1

LabelName.Caption = LabelName.Caption & Mid(strMsg, I, 1)

End Sub

The message will continuously scroll.

To open and close this form, you can use code on a command button on a
different form.
Depending upon your version of Access, use (in Access 2000 or newer):

If CurrentProject.AllForms("frmRollMessage").IsLoaded Then
DoCmd.Close acForm, "frmRollMessage"
Else
DoCmd.OpenForm "frmRollMessage"
End If


In Access 97 or older:

If IsLoaded("frmRollMessage") Then
DoCmd.Close acForm, "frmRollMessage"
Else
DoCmd.OpenForm "frmRollMessage"
End If


In Access 97, copy this function (from the Northwind.mdb sample
database) into a Module.

Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is open in Form view or
Datasheet
view.

Const conObjStateClosed = 0
Const conDesignView = 0

If SysCmd(acSysCmdGetObjectState, acForm, strFormName)
conObjStateClosed Then
If Forms(strFormName).CurrentView conDesignView Then
IsLoaded = True
End If
End If
End Function


--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.