If Else Loop Problem -
I am having problem with loop
VB Code:
Private Sub Command2_Click()
If rst.EOF = True Then
MsgBox ("This is the last record of the database")
Else
rst.MoveNext
Text6.Text = rst.Fields("Name")
Text5.Text = rst.Fields("Address")
Text4.Text = rst.Fields("Email Address")
Text1.Text = rst.Fields("Home Number")
Text2.Text = rst.Fields("Office Number")
Text3.Text = rst.Fields("Mobile Number")
End If
End Sub
on compilation it gives the following error:
"The EOF or BOF has been reached or the current document has been deleted"
Actually it is checking the else loop, even though the if condition is satisfied...
Help please
Regards
Mohit
For loop , Problem -
Hey ,
when I try to use a new loop , the allready working loop stops tell the new finish ! that means that it can be only one working loop in my app. how can I bypass this problem ?
thanx ,
Too many loops -
I am coming from C/C++ and I am teaching myself VB. If there is a FAQ posted and I missed it, I apologize.
On to the question - why are there so many loops in VB? You have while, do while/loop, do until/loop, do loop/while, and do/loop until. It seems to me that while and do whil
PL/SQL FOR LOOP Problem -
Hey guys. I have a loop like this
BEGIN
FOR i IN 200..300 LOOP
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
/
How do you increment a loop by "n" number?
For instance if I wanted to incriment by 2 or 10 such as the output would be
200
210
220
230
etc...
like
What is a array / for loop and how can i use it -
I got a tip that i could use an array / for loop to get the number of times i had to make a if then statement lower. Problem is i have no idea what an array / for loop is. Right now my problem is that i have 50 if then statments saying if my pacman hits a wall, dont let him go throug
Strange Problem with Access!!!!!! -
Hi all,
Im having a problem with access updating tables to slow
If I run my program (it's a loop), and break after the first loop, and then look in my access table the data doesn't show up, but if I close the table and reopens it the data shows up(magic??)
I need the tables to u
Loop and stuff (RESOLVED) -
Hello!
Here's my problem, not really a loop one, but well, u'll see ;O)
In my program, the user enter a number (the number of his choice) in a textbox.
What I wanna do, is by using a loop, making all number between 1 and the number that the user entered in the textbox, appear in
Game Loop & Menu Problem -
I'm having a problem where I added Menu's to my game, and am using a While Wend loop for my game loop. Pause works as necessary too. My problem is, when the loop is running, I'd like to be able to click the Form's Menu's, and have my loop pause. However, you can't write menu_Click c
Updating Text or Label Fields within a Loop -
I've been having a problem with displaying information in a text or label field that can be changed inside a loop. Only the final value - when the loop is done - is in the field. It's almost like the loop is going faster than the the field can update.
Any ideas on how to make the te
A loop problem... -
I'll explain what my application is doing before I explain the problem:
Basically, I have a table in SQLServer containing information about an email (address, text, subject, attachments etc). What my VB application does is check through this table to see if any emails need to be se
Loop through database... -
Ok im back again and i am still trying to loop through my database in a template. is this how i would loop through it? i need to loop through the ID of the item first then while its still doing that print out the data?
so
loop {
$dbid
loop {
$dbtext
}
}
or som
problem with this loop -
i got a problem here and dont know what to do about it
well i have the microsoft media control component in my form
and i loaded a wave file and played it
works perfect
butttttttttttttttt
u know how wave files get so big as they become long
i have an alarm sound
sum beep kinda t
Try this one on for size. Loops -
I have a spreadsheet that can loop through rows no problem.
How do I get it to loop across columns, because they do not have numbers.
I thought converting using Asc() would do the trick, but that didn't work when I got to columns like BU.
My loop will check values in row one f
parse text file with loop inside -
i'm trying to parse a text file, the problem is that at certain points of the file, i need to loop through certain parts of the file. For example:
**tag1 : some info here
**tag2 : more info
**tag3 : info
**this is where i need to loop thru
**info, if there is no colons on the l
problem returning to loop -
Processing records in a loop... some of them need user interaction to choose from a collection of possibilities...
I don't seem to be able to return to the loop and continue processing. Can someone help me with a formula or reference to code examples that do this? Thanks David
vb print problem -
Okay new problem...
I have generated some numbers into a table created out of textboxes Text1(1-3),Text2(1-3),Text3(1-3), ETC.
Im in a loop that fills in the text boxes with random numbers and now i want to print it each times it loops.
With printform it prints the whole for
transfering control out of a loop -
I am quite new to VB. If I start a loop by clicking a command button, and the loop goes on for some time, I find I cannot access other command buttons until the first loop is finished. Can I transfer control away from the loop without stopping the loop ?
continuous loop preventing form from displaying -
i have form1 which kicks off a form2
in form2 i have a loop which updates a listview
i want the loop to run continuously until i kill the program (i will eventually add multi-threading but have not yet)
the loop displays data in a listview, then sleeps then displays next page
WaitForSingleObject, WaitForMultipleObject [NEWLY Revised] -
PROBLEM: Can't get Do/Loop and Timer/Loop to Exit
I have a static counter in the PAINT event to set up a trigger to call a Do/Loop.
This is done to allow the screen to be painted to a certain point and then the loop is designed to finish painting the screen in slow motion.
Half-tranparant form with progressbar on from -
Hi,
I have a child MDI form. From it, I call a module, which runs a loop.
Just before the loop, I open a from with a progressbar on it, and during the loop the progressbar has to be filled. No problem with that though, but here is the problem.
During the loop, my "progressfo
loops interacting with screensaver -
When I run a loop with my .NET project that's lengthy enough for the screensaver to be triggered, the screensaver interacts with the loop. I can't get the screen back clearly until the task involving the loop is finished.
I understand that 'For Events' solved this problem with VB6,
i have a looping question -
i have an issue with my loop for some reason it dosent read the last record in my file... here is my loop...
Open input_file For Input As #1
Open DATA_STREAM_OUT_FILE For Output As #3
Line Input #1, INPUT_LINE
Do While Not EOF(1)
Print #3, DATA_STREAM_OUT
noob question about for each loop. -
Hi, just to ask something
i have a for each loop
eg
for each xx in yyy then
if xx == "something" then
' is it possible to loop next element?
end if
code1()
code2()
next
so, i would like to ask, if xx condition is true, is it possible to skip that that
Array problem in loop. -
let suppose I have five textboxes on a form. I took 5 inputs for each textbox in a loop, now how do i assign those values to textboxes within same or another loop.
when I try
text(a).text= num(a)
VB do not recognize it.
Help Debugging a Crashing/closing program.. -
Ok so my situation is kind of wierd.
The bug is not solidly reproducable, it seems to happen 'randomly'.
The biggest problem is this, when it crashes there is no error message by windows given or anything else. The application just closes. Since it happens randomly and its a la
Returning to the top of a loop -
I hope this isn't a stupid question, but how do I return to the top of a Do Loop? I'll be processing items in a loop and I have a warning, so I don't want to exit the loop, but I don't want to continue, just return to the top of the loop with the next element. For example:
Do Until
Problem With Variable In Loop -
Hello!
I have a little problem but can't figure it out. Here is it. The problem is that in the loop k never becomes equal to 1. The loop stops for k = 0. Why??? Any ideas??? All variables are integer by the way!
Code:
p1 = UBound(Array, 1) -> Array is dynamic array
p2 =
How can I call a sub and tell it to stop executing -
Hi, I have a little problem.
I have a main loop something like:
Do
'code here
if Collision then Explode
Do Events
Loop
--------------------------------------------
Sub Explode()
'explosion code
End sub
So I have a loop that checks for collisions in my game and if
If...Then within Do...Loop -
Hi.
I've written a program that opens a txt file, reads the numbers in it. Adds them up and then outputs them into another txt file. Sounds boring I know, but it is part of a much more interesting program.
The program uses a Do...Loop to read one line from the file, output and th
how to end the for loop -
i know it sound simple, but i really don't know how to end the for loop..what i want to do is, after satisfying the condition inside the for loop, i want it to exit from the loop..i don't know how to do it..what command should i use?
....Beginners problem (VB5) -
I have an 'IF THEN ELSE' loop. But I would like to have another IF THEN loop inside this (just one simple if then). Is this possible? Or should I be looking at something different altogether?
Thanks folks, your help is invaluable.
Much appreciated.
Application.DoEvents() Problem -
Ok I am having a bit of a problem here. I am writing a server in vb.net. I need to run a loop that does not stop until I tell it too by the press of a button. So I put Application.DoEvents() in the loop. However, my program still locks up and will not respond. What is going on. I
I don't need thread neither multitask -
I know that exist threads in VB, and I'm with no time to see that right now.
I don't even want multi-task.
I just want to make a timer working INSIDE a loop.
Why?
Well, I have two loops that go all over two different recordsets (no, I wont use INNER JOIN with Access), and i
Do-Loop -
I have a Do-Loop in one of my modules, and when I call that Sub, it gives me 'Loop without Do'. I have 312 lines of code between the Do and Loop. Is there some sort of limit that I don't know about?
How to give different name for each listbox in a loop -
I want to create a list box at run time in a loop and the loop counter will be picked up the Database at run time..... if i give the same single name for the each list box it will not create problem during taking the value of any listbox coz the name wil be same...so i want to conacati
play, pause, stop with an avi :) Sorted Out*** -
hi all,
i can extract frames out of an avi and display them on the screen.
i wish to create a simple app that has within it a play button, a pause button, and a stop button. (im using Borland Builder 5)
my problem is when i press the play button my program goes into a loop (a fo
a bit of a dilema with many sockets, threads, windows messages, and MFC -
I'm making a network analyzer / Administration tool and one of the features that im working on is a port scanner. Im tryin to make it really fast so i made a thread and my own CMySock class derived from CAsyncSocket. In the thread i declare a large array of these sockets and then have
conditional in loop -
hi, could someone please help me out with this -
i have some code which goes like this
whilie (condition1)
for i = 1 to rs.recordcount
if (condition2) then
statement1
else
statement2
end if
next i
wend
my problem is - even if the if - condi
For loop ..exit -
If I am running a loop function
Dim i as interger
For loop 1 to 5
if i = 2
Then Escape
Next
As what i concern is I need to stop or out of the loop immediately after i is matching to the number 2. What's the proper way to implement this without
Read from file into buffer (problem) -
Hello all of you out there....
I have a file, lets say it has a size of 1MB
I need to encode each byte of the file!
If I use a loop from 1 to FileSize , It is damn slow!
I dont want the Processing-Time function to be linear like O(n).
But when I read everytime 2048 bytes into
do loop -
can I have two stopping condition to stop a do loop
eg :
do
'instructions..........
loop until x=3
or loop until x =5 (is this or similar possible)