...and created this little fun VBA code. Simply create a Command Button (btnStartConversation) and a Text Field (txtConversation). Plug in this code to the button and have a laugh.
DetailsOption Compare Database Option Explicit
'This code is brought to you by Fred Stetson, of Stetson Management Solutions 'You may use this code as long as you keep this statement intact.
Private Sub btnStartConversation_Click() Me.Refresh Dim conversation As Variant Dim i As Integer Dim conversationText As String
' Define the conversation lines in an array conversation = Array( _ "Abbott: Who's on first?", _ "Costello: What?", _ "Abbott: Who's on first?", _ "Costello: What? The guy's name?", _ "Abbott: No, Who's on first!", _ "Costello: I'm asking you, what's the guy's name?", _ "Abbott: That's the man's name.", _ "Costello: Who?", _ "Abbott: Yes, that's right.", _ "Costello: Who's right?", _ "Abbott: Yes.", _ "Costello: So, the guy's name is 'Yes'?", _ "Abbott: No, the guy's name is 'Who'.", _ "Costello: Who's on first?", _ "Abbott: What?", _ "Costello: What is the guy's name?", _ "Abbott: No, the guy's name is 'Who'.", _ "Costello: That's what I'm asking!", _ "Abbott: No, you're asking, 'What?' That's what I'm trying to tell you. The guy's name is 'Who'." _ )
' Clear the text box Me.txtConversation.Value = ""
' Loop through the conversation array and display each part with a pause For i = LBound(conversation) To UBound(conversation) conversationText = conversation(i)
' Add text to the textbox with a line break Me.txtConversation.Value = Me.txtConversation.Value & conversationText & vbCrLf
' Pause for a brief moment between lines DoEvents Pause (1.5) ' Pause for 1.5 seconds Next i
End Sub
' Simple Pause function to create delay Private Sub Pause(seconds As Integer) Dim startTime As Double startTime = Timer Do While Timer < startTime + seconds DoEvents Loop End Sub
Private Sub txtConversation_BeforeUpdate(Cancel As Integer) Me.Refresh End Sub
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
General Discussion Forum.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.