Click here to Skip to main content
15,923,689 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionBasic looping problem Pin
kanchoette6-Feb-09 2:32
kanchoette6-Feb-09 2:32 
AnswerRe: Basic looping problem Pin
Henry Minute6-Feb-09 2:37
Henry Minute6-Feb-09 2:37 
GeneralRe: Basic looping problem Pin
kanchoette6-Feb-09 2:43
kanchoette6-Feb-09 2:43 
GeneralRe: Basic looping problem Pin
Henry Minute6-Feb-09 2:52
Henry Minute6-Feb-09 2:52 
AnswerRe: Basic looping problem Pin
Mr Oizo6-Feb-09 3:12
Mr Oizo6-Feb-09 3:12 
GeneralRe: Basic looping problem Pin
Guffa6-Feb-09 7:53
Guffa6-Feb-09 7:53 
AnswerRe: Basic looping problem Pin
nlarson116-Feb-09 8:14
nlarson116-Feb-09 8:14 
AnswerRe: Basic looping problem Pin
Guffa7-Feb-09 5:24
Guffa7-Feb-09 5:24 
Don't call the Now method repeatedly, that is bad practice. In this specific case it's quite unlikely, but the reason is that the value returned by Now changes, so you can get different values from one call to the next. Get the value into a variable, and use the variable repeatedly.

When you loop from a higher value to a lower, you have to put the higher value first in the For statement:
Dim year As Integer = DateTime.Now.Year
For x As Integer = year To year - 20 Step -1
   form.YearFromComboBox.Items.Add(x.ToString())
Next


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Basic looping problem Pin
Samir Ibrahim7-Feb-09 5:49
Samir Ibrahim7-Feb-09 5:49 
GeneralRe: Basic looping problem Pin
Guffa7-Feb-09 8:59
Guffa7-Feb-09 8:59 
GeneralRe: Basic looping problem Pin
Samir Ibrahim10-Feb-09 2:41
Samir Ibrahim10-Feb-09 2:41 
GeneralRe: Basic looping problem Pin
Guffa10-Feb-09 6:43
Guffa10-Feb-09 6:43 
GeneralRe: Basic looping problem Pin
Samir Ibrahim10-Feb-09 7:31
Samir Ibrahim10-Feb-09 7:31 
QuestionGroupbox problem Pin
cstrader2326-Feb-09 2:20
cstrader2326-Feb-09 2:20 
AnswerRe: Groupbox problem Pin
JoeSharp6-Feb-09 2:42
JoeSharp6-Feb-09 2:42 
GeneralRe: Groupbox problem Pin
cstrader2326-Feb-09 3:13
cstrader2326-Feb-09 3:13 
GeneralRe: Groupbox problem [modified] Pin
Rekless3-Jan-10 14:00
Rekless3-Jan-10 14:00 
Questionworking with Crystal Report with VB 6 Pin
jayachandra.c6-Feb-09 2:14
jayachandra.c6-Feb-09 2:14 
Questionfile recovery Pin
cst_kvp6-Feb-09 1:52
cst_kvp6-Feb-09 1:52 
AnswerRe: file recovery Pin
EliottA6-Feb-09 2:45
EliottA6-Feb-09 2:45 
GeneralRe: file recovery Pin
Luc Pattyn6-Feb-09 9:30
sitebuilderLuc Pattyn6-Feb-09 9:30 
AnswerRe: file recovery Pin
Dave Kreskowiak6-Feb-09 3:43
mveDave Kreskowiak6-Feb-09 3:43 
AnswerRe: file recovery Pin
0x3c06-Feb-09 8:17
0x3c06-Feb-09 8:17 
QuestionDataGridView selection back color problem Pin
Jay Royall5-Feb-09 23:44
Jay Royall5-Feb-09 23:44 
GeneralGenerating codes for fingerprint security door using VB.Net Pin
awoyale5-Feb-09 22:21
awoyale5-Feb-09 22:21 

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.