|
-
Dec 23rd, 2009, 07:45 AM
#1
Thread Starter
Addicted Member
Help Needed
Hi I am having a little trouble with my code.........here is what I currently have:
Code:
Private Sub initfrmCalendar()
Dim i As Integer 'Used as a counter
Dim iDay As Integer 'Used to set the day
setStartIndex 'Set the starting index, first textbox to use
setEndIndex 'Set the ending index, last textbox to use
clearTextboxes 'Clear the calendar
iDay = 1
'Loop to fill the textboxes with days
'Also to re-enable the disabled ones
While iDay <= iEndIndex
txtDay(iStartIndex).Text = iDay
txtDay(iStartIndex).Enabled = True 'Re-enable
txtDay(iStartIndex).BackColor = vbWhite 'Reset the color
iDay = iDay + 1
iStartIndex = iStartIndex + 1
Wend
disableUnusedBoxes
End Sub
Its giving an error msg on the txtDay part, saying "wrong number of arguments or invalid property assignment" the txtDay is currently a button and I what it to loop thou all the buttons, i have a control array txtDay handed coded as I am using vba,
thanx
-
Dec 23rd, 2009, 08:11 AM
#2
Re: Help Needed
Shouldn't "txtDay(iStartIndex).Text"
be "txtDay(iStartIndex).Caption" instead?
I don't know if "VBA" is different than "VB" or not on this one...
-
Dec 23rd, 2009, 08:52 AM
#3
Re: Help Needed
 Originally Posted by helen85
I am using vba,
VBA and VB6 are significantly different in several ways (particularly controls etc), which is why we have different forums for them - Thread moved from the 'VB6' forum to the 'Office Development/VBA' forum
-
Dec 23rd, 2009, 02:44 PM
#4
Addicted Member
Re: Help Needed
 Originally Posted by vbfbryce
Shouldn't "txtDay(iStartIndex).Text"
be "txtDay(iStartIndex).Caption" instead?
I don't know if "VBA" is different than "VB" or not on this one...
Got it in one vbfbryce. Since txtDay is button, then the ".text" should be ".Caption". This is no different than in VB6.
helen85: You should try naming your controls to reflect their type. The name "txtDay" makes it appear that you're dealing with a textbox. Perhaps renaming the control to "cmdDay" or "btnDay" would remove some of the ambiguity.
Cheers.
-EM
---
REMEMBER: If your issue is resolved, use the Thread Tools menu to set it as such, and be sure to rate the posts that help you the most!

Just because I was jealous of g4hsean! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|