Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default time/timing/breakpoint

A button in my form is supposed to assign the actual time to tbtime, which
has a ControlSource assigned.

Private Sub cbtime_Click()
tbtime.Value = Time
Call bnNext_Click
End Sub

The "next" part works. The "time" part
doesn't work
- without breakpoint
- with breakpoint and "Continue"
does work
- with breakpoint and F8

"breakpoint" refers to a breakpoint at tbtime.value = time

Could somebody illuminate me? Why does this happen and how can I correct the
problem?

Oskar von dem Hagen

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default time/timing/breakpoint

Not sure I fully understand.

What is btnNext, and what does it do? I assume tbTime is a textbox. What
relevance does ControlSource have?

--
HTH

Bob Phillips

"Oskar von dem Hagen" wrote in
message ...
A button in my form is supposed to assign the actual time to tbtime, which
has a ControlSource assigned.

Private Sub cbtime_Click()
tbtime.Value = Time
Call bnNext_Click
End Sub

The "next" part works. The "time" part
doesn't work
- without breakpoint
- with breakpoint and "Continue"
does work
- with breakpoint and F8

"breakpoint" refers to a breakpoint at tbtime.value = time

Could somebody illuminate me? Why does this happen and how can I correct

the
problem?

Oskar von dem Hagen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default time/timing/breakpoint

Apologies if I was too brief. :-)

Excel 2000, Windows 2000 SP 4. The modeless form loads a row of an excel
table. Most of the fields in the form are linked to cells in that row (e.g.
the textbox tbtime may have the controlsource AW18).

The button cbtime is supposed to set the textbox tbtime (and the cell AW18)
to the actual time and then proceeds to the next record (row) by "pressing"
the button cbnext.

Pressing cbtime without breakpoint leaves AW18 empty and proceeds to the
next record. Setting a breakpoint and executing stepwise sets the time as
intended and then proceeds to the next record.

Oska von dem Hagen
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default time/timing/breakpoint

I guess the reason you are seeing it populated in step mode is because it is
getting cleared out later, and that normally happens so fast that you don't
see it. Something like

- time button clicked
- textbox populated
- cell populated
- something then clears textbox, and hence cell

So in step mode, you will see data in the cell before the 4th step.

Do you load the tbTime textbox when you hit the next button? If so, and the
source is blank, that will be the cause, as cell AW18 being linked to the
textbox will also clear down.

Do want to show the whole form code?

--
HTH

Bob Phillips

"Oskar von dem Hagen" wrote in
message ...
Apologies if I was too brief. :-)

Excel 2000, Windows 2000 SP 4. The modeless form loads a row of an excel
table. Most of the fields in the form are linked to cells in that row

(e.g.
the textbox tbtime may have the controlsource AW18).

The button cbtime is supposed to set the textbox tbtime (and the cell

AW18)
to the actual time and then proceeds to the next record (row) by

"pressing"
the button cbnext.

Pressing cbtime without breakpoint leaves AW18 empty and proceeds to the
next record. Setting a breakpoint and executing stepwise sets the time as
intended and then proceeds to the next record.

Oska von dem Hagen



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default time/timing/breakpoint

The whole code is a bit messy. (I hope the excerpt, see below, contains all
relevant information.). It's basically an applied example from Bullen et al.
modified to have formulas as database entries and using a class module to
catch PgDn/PgUp keys.

If I use step mode, the cell remains populated.

Oskar von dem Hagen

P.S. (Longer) Code excerpt:
Private Sub UserForm_Initialize()
Dim temp As Integer
[...]
'Load 1st record in Datenbank and initialise scrollbar
With Range("Datenbank")
temp = ActiveCell.Row - 12
sbNavigator.Max = .Rows.Count
If Not (temp 2) Then
sbNavigator.Value = 2
Set rgData = .Rows(sbNavigator.Value)
Call LoadRecord
ElseIf Not (temp <= sbNavigator.Max) Then
sbNavigator.Value = sbNavigator.Max
Else
sbNavigator.Value = temp
End If
End With
[...]
End Sub

Private Sub LoadRecord()
[...]
tbtime.ControlSource = rgData.Cells(1, 49).Address()
End Sub

Private Sub sbNavigator_Change()
'When Scrollbar value changes, save current record and load
'record number corresponding to scrollbar value
Set rgData = Range("Datenbank").Rows(sbNavigator.Value)
[D12].Value = sbNavigator.Value
Call LoadRecord
End Sub

Public Sub bnNext_Click()
With Range("Datenbank")
If rgData.Row < .Rows(.Rows.Count).Row Then
'Load next record only if not on last record
sbNavigator.Value = sbNavigator.Value + 1
'Note: Setting sbNavigator.Value runs its Change event procedure
End If
End With
End Sub

Private Sub cbtime_Click()
tbtime.Value = Time
Call bnNext_Click
End Sub
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
breakpoint calculation John C[_2_] Excel Worksheet Functions 0 October 22nd 08 02:27 PM
breakpoint calculation Ron Rosenfeld Excel Worksheet Functions 0 October 22nd 08 03:07 AM
breakpoint calculation Teethless mama Excel Worksheet Functions 0 October 22nd 08 03:02 AM
How can I enter time in Excel in 10:15:10:02 for sport timing ? Mathias Charts and Charting in Excel 4 October 18th 08 09:09 PM
SQL fails without breakpoint arno Excel Programming 1 June 3rd 04 06:57 AM


All times are GMT +1. The time now is 04:55 PM.

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"