Hi looks like you have some global variables defined somewhere not in this code snippet. Could you also post these declarations?
Thanks
Hi, thanks but I didnt declare any variable except the control variable(i) for looping, well, even as I added Weekday as variable I get these results(7,1,2,3,4,5,6). I dont know why its giving numbers instead of weekdays in local language. Thats the problem i am having at the moment. Here is how its been improved on now:
Option Explicit
Private Sub Form_Load()
Call GetWeekDay
Call Update_Controls
End Sub
Private Function GetWeekDay()
On Error Resume Next................................'I had to change this in order to
'make it run without error
Dim Weekday(6) As Date...... 'Gives same reult whether or not present'
Weekday(0) = WeekdayName(vbUseSystemDayOfWeek)
Weekday(1) = WeekdayName(vbTuesday)
Weekday(2) = WeekdayName(vbWednesday)
Weekday(3) = WeekdayName(vbThursday)
Weekday(4) = WeekdayName(vbFriday)
Weekday(5) = WeekdayName(vbSaturday)
Weekday(6) = WeekdayName(vbSunday)
Dim i As Integer
For i = 0 To 5
Load txtwkdayname(txtwkdayname.UBound + 1)
txtwkdayname(txtwkdayname.UBound).Top = (txtwkdayname(i).Top + txtwkdayname(i).Height) + 8................................................. .......................'needed to avoid cluttering
txtwkdayname(txtwkdayname.UBound).Visible = True
Next i
End Function
Private Sub Update_Controls()
Dim i As Integer
For i = 0 To txtwkdayname.UBound
txtwkdayname(i).Text = Weekday(i)
Next i
End Sub