Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime...Please Help

Hello!

I am working with a cognitive psychology test, which will serve as a
independant variable. The test runs a userform which consists of
random number and a random data set (consisting of 5 numbers). I hav
all of the fuctionallity setup except for the delay between the rando
number and the data set.

I would like the userform to open, display the random number for (2
seconds, then delete it from the text box. (1) second later the dat
set is shown for (1) second, then delete it from the test box.

The tricky part is to start the timer at the time the dataset is show
up until the participate presses the appropriate selection

I have attached the document I am using...

Thanks,
Mik

Attachment filename: cog test.zip
Download attachment: http://www.excelforum.com/attachment.php?postid=55346
--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default OnTime...Please Help

Michael,

Here is a simple example to set the textbox

Dim starttime As Double

Private Sub CommandButton1_Click()

TextBox1.Text = "Another value"

starttime = Now + TimeSerial(0, 0, 1)
Application.OnTime starttime, "clearTextbox", schedule:=True

End Sub

Private Sub UserForm_Activate()

TextBox1.Text = "Some value"

starttime = Now + TimeSerial(0, 0, 2)
Application.OnTime starttime, "clearTextbox", schedule:=True

End Sub

and you also need a procedure in a standard module that reacts to the OnTime
method

Sub clearTextbox()
UserForm1.TextBox1.Text = ""
End Sub


Also, take a look at www.cpearson.com/excel/ontime.htm for more details.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael_I " wrote in message
...
Hello!

I am working with a cognitive psychology test, which will serve as an
independant variable. The test runs a userform which consists of a
random number and a random data set (consisting of 5 numbers). I have
all of the fuctionallity setup except for the delay between the random
number and the data set.

I would like the userform to open, display the random number for (2)
seconds, then delete it from the text box. (1) second later the data
set is shown for (1) second, then delete it from the test box.

The tricky part is to start the timer at the time the dataset is shown
up until the participate presses the appropriate selection

I have attached the document I am using...

Thanks,
Mike

Attachment filename: cog test.zip
Download attachment:

http://www.excelforum.com/attachment.php?postid=553466
---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime...Please Help

Hello Bob!

I like the way you explained the solution! I have been through th
code that you have provided along with the code on Chip's site. I a
still running into a problem. I can get both textboxes that I a
working with to display the random number and also the dataset and the
clear the text box. The problem that I am running into is that the
display at the same time. I need textbox1 to be displayed, the
textbox2. This has to happen without the use of another button (i
must run when the userform initializes).

Any suggestions how to make a pause, delete textbox1 the show textbox
- while in the same module? I was thinking that I could just call th
ontime to create the pause, but it does not seem to be working.

Thanks,
Mik

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default OnTime...Please Help

Michael,

Try this version

Dim endTime As Double

Private Sub UserForm_Activate()

TextBox1.Text = "Some value"

endTime= Now + TimeSerial(0, 0, 2)
Application.OnTime endTime , "clearTextbox1", schedule:=True

End Sub

as before, you need a procedure (actually two) in a standard module that
reacts to the OnTime
method

Sub clearTextbox1()

With UserForm1
.TextBox1.Text = ""
.TextBox2.Text = "Another value"
End With

endTime = Now + TimeSerial(0, 0, 1)
Application.OnTime endTime , "clearTextbox2", schedule:=True

End Sub


Sub clearTextbox2()
UserForm1.TextBox2.Text = ""
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael_I " wrote in message
...
Hello Bob!

I like the way you explained the solution! I have been through the
code that you have provided along with the code on Chip's site. I am
still running into a problem. I can get both textboxes that I am
working with to display the random number and also the dataset and then
clear the text box. The problem that I am running into is that they
display at the same time. I need textbox1 to be displayed, then
textbox2. This has to happen without the use of another button (it
must run when the userform initializes).

Any suggestions how to make a pause, delete textbox1 the show textbox2
- while in the same module? I was thinking that I could just call the
ontime to create the pause, but it does not seem to be working.

Thanks,
Mike


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime...Please Help

o.k....this is really starting to hurt my head.

It seems that everything should be working with the appropriate code
but it is not. The first value is showing, and staying...nothing else

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default OnTime...Please Help

Michael,

Why not send we the workbook, and I'll take a look at it?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael_I " wrote in message
...
o.k....this is really starting to hurt my head.

It seems that everything should be working with the appropriate code,
but it is not. The first value is showing, and staying...nothing else.


---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime...Please Help

Thanks Bob!


It is attached on my first post in this thread.

Mik

--
Message posted from http://www.ExcelForum.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default OnTime...Please Help

Michael,

I will need your email address as I do not post attachments to the NG, and I
cannot see it through the ExcelForum layer.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael_I " wrote in message
...
Thanks Bob!


It is attached on my first post in this thread.

Mike


---
Message posted from http://www.ExcelForum.com/



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnTime...Please Help



--
Message posted from
http://www.ExcelForum.com

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default OnTime...Please Help

Thanks Michael, response in the mail.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael_I " wrote in message
...



---
Message posted from
http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find %ontime & SUMIF ontime ie: find matching sets within Range... Chris T-M Excel Worksheet Functions 3 October 10th 08 08:14 PM
.ontime Grrrrrumpy Excel Discussion (Misc queries) 2 April 8th 07 04:18 PM
OnTime VB [email protected] Excel Discussion (Misc queries) 5 May 17th 06 10:53 PM
OnTime VB [email protected] Excel Worksheet Functions 2 May 16th 06 08:43 PM
OnTime Help Mark Scholes Excel Programming 1 January 30th 04 03:48 AM


All times are GMT +1. The time now is 01:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"