Click here to Skip to main content
15,888,968 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalto database or not to database Pin
rigamonk16-May-04 10:29
rigamonk16-May-04 10:29 
GeneralRe: to database or not to database Pin
Mike Ellison16-May-04 10:48
Mike Ellison16-May-04 10:48 
GeneralRe: to database or not to database Pin
VBGuruWantabe17-May-04 11:00
VBGuruWantabe17-May-04 11:00 
GeneralRe: to database or not to database Pin
VBGuruWantabe17-May-04 11:02
VBGuruWantabe17-May-04 11:02 
GeneralVB6 - Open the DOS window Pin
xfitr216-May-04 9:57
xfitr216-May-04 9:57 
GeneralRe: VB6 - Open the DOS window Pin
VBGuruWantabe17-May-04 11:11
VBGuruWantabe17-May-04 11:11 
Generalgetting paint even to fire on button click Pin
kowplunk15-May-04 16:24
kowplunk15-May-04 16:24 
Questioncan someone tell me how to correct this Pin
Member 84306415-May-04 5:39
Member 84306415-May-04 5:39 
Public Sub CalcDaysWorked()
Dim I, X As Integer



For I = 41 To 1 Step -1
If (FrmCalendar.TxtDate(I).Text = "1") Or ((FrmCalendar.TxtDate(I).Text = "2") Or (FrmCalendar.TxtDate(I).Text = "3") Or _
(FrmCalendar.TxtDate(I).Text = "7")) Then
FrmCalendar.TxtDaysWrkd.Text = (Val(X))
Exit Sub
Else
If FrmCalendar.TxtDate(I).Text = "W" Then
X = (X + 1)
Else
If (FrmCalendar.TxtDate(I).Text <> "1") Or ((FrmCalendar.TxtDate(I).Text <> "2") Or _
(FrmCalendar.TxtDate(I).Text <> "3") Or (FrmCalendar.TxtDate(I).Text <> "7")) Then 'IGNORE IT
I = (I - 1)
End If
End If
End If
Next I
FrmCalendar.TxtDaysWrkd.Text = (Val(X))
FrmCalendar.TxtDaysWrkd.Refresh
End Sub

BAsically this is part of an employees attendance/work record it keeps track of points(1,2,3 or 7)

days worked"w"

and some misc info that need not be tracked for this calculation
thus the I=I-1 'to ignore the entry

I need to calculate the days worked (my w's) after the last occurance of an infraction(1,2,3 or 7)

My code works 100% however i forsee an error if a "w" is enetered on the last day of the month

This is because the x values is only calulating on ever other loop through the code

The problem is in the above code..When I debug it it gets called on correctly everytime but the "x" value is not incrementing by 1 every time!


Greg S
Generalchange source of Datagrid from the other form Pin
Member 110087015-May-04 5:06
Member 110087015-May-04 5:06 
GeneralMDI forms Pin
meesh15-May-04 1:32
meesh15-May-04 1:32 
GeneralRe: MDI forms Pin
Aaron Eldreth15-May-04 2:56
Aaron Eldreth15-May-04 2:56 
GeneralMIDI PLEASE, AGAIN AND AGAIN... Pin
Nadroj14-May-04 21:00
Nadroj14-May-04 21:00 
GeneralRe: MIDI PLEASE, AGAIN AND AGAIN... Pin
Aaron Eldreth15-May-04 2:50
Aaron Eldreth15-May-04 2:50 
GeneralRe: MIDI PLEASE, AGAIN AND AGAIN... Pin
Nadroj15-May-04 7:11
Nadroj15-May-04 7:11 
GeneralRe: MIDI PLEASE, AGAIN AND AGAIN... Pin
Ray Cassick15-May-04 9:00
Ray Cassick15-May-04 9:00 
GeneralRe: MIDI PLEASE, AGAIN AND AGAIN... Pin
Aaron Eldreth15-May-04 9:39
Aaron Eldreth15-May-04 9:39 
GeneralRe: MIDI PLEASE, AGAIN AND AGAIN... Pin
Ray Cassick15-May-04 9:45
Ray Cassick15-May-04 9:45 
GeneralRe: MIDI PLEASE, AGAIN AND AGAIN... Pin
Aaron Eldreth15-May-04 14:51
Aaron Eldreth15-May-04 14:51 
GeneralPassing information between forms Pin
pj4FarEweDsf14-May-04 14:31
pj4FarEweDsf14-May-04 14:31 
GeneralRe: Passing information between forms Pin
Nick Seng14-May-04 15:28
Nick Seng14-May-04 15:28 
GeneralRe: Passing information between forms Pin
rubdub16-May-04 22:27
rubdub16-May-04 22:27 
GeneralRe: Passing information between forms Pin
pj4FarEweDsf17-May-04 5:31
pj4FarEweDsf17-May-04 5:31 
Generalrowstate changes when sybasecommandbuilder is created Pin
CodeAgnostic14-May-04 9:59
CodeAgnostic14-May-04 9:59 
GeneralConvert e to uppercase Pin
XGaMeS14-May-04 8:46
XGaMeS14-May-04 8:46 
GeneralRe: Convert e to uppercase Pin
Aaron Eldreth14-May-04 10:09
Aaron Eldreth14-May-04 10:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.