Share Your Source Code or Article

Do you have source code, articles, tutorials, web links, and books to share? You can write your own content here. You can even have your own blog.

Submit now...

Database Programming Made Easy

This tutorial will teach you step by step on how to connect and manipulate database. If you'd like to suggest a tutorial please write a comment at the bottom of this article.

Read more...

Hire Us to Do Your Work

Do you want a customized system? Do you want to setup your own website to do business? Then we are here to help you in your programming needs.

Read more...

Search

How to make looping statement in vb
17 replies [Last post]
User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010


hi guyz specially to admin can you ,help me about my problem in looping i cant make it




=>> Lynesus <<==

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
re

tingnan mo ung database table mo then punta ka sa design view tingnan mo dun kung nakaset ang Required sa YES,,set mo yung Required=NO then Allow Zero Length=YES

=>> Lynesus <<==

Anonymous
hello!!! anyone help me please..

ask ko lng po bakit nagkakaron ng error na invalid null kapag nag-add na ako ng records ko sa na addform ko kapag binalikan ko ung ms-access ko meron na 1 na naka- blank kaya null na sy.. sa vb 6.0 po ha..

cidfrey's picture
User offline. Last seen 1 week 13 hours ago. Offline
Joined: 12/17/2009
Dude

Use Do Until tpos sa end nya lagay ka ng Loop =)

System Developer
Contacts :
09087076539
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
re

yah,, you're right..

actually i've already solved that problem last night..

tnx to you guyz...

ipagpapatuloy q na paggawa ng thesis q,,if my problem prin i will post it here..

tnx again..

=>> Lynesus <<==

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
re

ganito kc un,,

ang login form q is like calculator pero numbers lng meron design kc sya for touchscreen like different information kiosk

I already finished the design of my project and the only problem is the looping statement

kung d nya makita yung match na user move xa sa next record hanggang makita nya ung user

=>> Lynesus <<==

Anonymous
advice lang!!!

try mu kya i trap ung error...
gumamit k ng break point every line
dun mo mkkta if bakit d gumagana ung loop,
break point is good in case of debugging.

jaysfall's picture
User offline. Last seen 5 weeks 2 days ago. Offline
Joined: 01/20/2010
re:

its like just youre comparing a sql statement dba.hehe
gnto siguru un..ah siguru ung mga numbers eh nka array po un..
so it means you will need a for loop..

example:
nakaaray po ung cmd jan
Private Sub Command1_Click(Index As Integer)
'Label2.Caption = ""
For x = 0 To 2 'so tatlo lng ung cmd x represent its index
If Command1(x).Value = True Then
Label2.Caption = Label2.Caption & Command1(x).Caption
End If
Next x
End Sub

rs.open"select * from table where username="& val( label2.caption) &"",con,2,3

if not rs.eof then
msgbox"sdfsdfsf"
else
msgbox"sdfsdf"
end if

hehe try mo!

::jayxceleste@ymail.com::
09161514777
::Colegio De Sta. Teresa De Avila Foundation Inc::
::Fairview,Quezon City::
::College of Information Technology::

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
re

hindi po kc ako pwede gumamit ng combo box sa project na ga2win ko...

designed for touchscreen sya and for viewing of informations only like kiosk terminal na maki2ta sa different universities...

tnx for your replies and suggestions

=>> Lynesus <<==

Anonymous
hahaha..

ngee.kasi post mo lng eh f panu mg looping..so aun.haha
anu b gusto mo mngyari ah..?

jaysfall's picture
User offline. Last seen 5 weeks 2 days ago. Offline
Joined: 01/20/2010
FOR LOOP :

The output will be in the c combobox
gaya neto"2009-2010"
Gingamit to sa Semester table hehe
ilagay mo to sa form load

Private Sub Form_Load()
Dim x
For x = 2010 To 2000 Step -1
Combo1.AddItem x & "-" & x + 1
Next x
End Sub

oh yan ..sana makatulong.hehe

::jayxceleste@ymail.com::
09161514777
::Colegio De Sta. Teresa De Avila Foundation Inc::
::Fairview,Quezon City::
::College of Information Technology::

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
help me!!asap

hi guys will u help me about looping statement in my thesis. I think it has an error because the code is not functioning will you help me to debug the error?

here's my code...

Private Sub cmdenter_Click()
Call Entry

Set DataGrid1.DataSource = rs
If lblscreen(0).Caption = "" Then
MsgBox "Enter your ID Number first.", vbCritical, "System Security"
Else
If Not rs.BOF Then
rs.MoveFirst
End If
Do Until rs.EOF = True
If lblscreen(0) <> rs!stud_id Then
Exit Do
Else
With studinfo2
.Show
.lblIDno = rs!stud_id
.lblname = rs!full_name
.lblage = rs!age
.Label6(0) = rs!gender
.Label7 = rs!address
.Label8 = rs!year_level
.Label9 = rs!course
.Label10 = rs!c_major
End With
Unload Me
Exit Do
End If
Loop
End If
End Sub

Public Sub Entry()
Set rs = New ADODB.Recordset
rs.Open "Select * from sa03_user_01 where stud_id like '" & LogMeIn.lblscreen(0).Caption & "'", cn, adOpenKeyset, adLockPessimistic
End Sub

Public Sub myCon()
Dim mDataSource As String

mDataSource = "database/kiosk.mdb"
Set cn = New ADODB.Connection

cn.CursorLocation = adUseClient
cn.CommandTimeout = 0
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mDataSource & ";Persist Security Info=False"

Set rs = New ADODB.Recordset
End Sub

help me please..tnx,,godbless

=>> Lynesus <<==

Anonymous
Unload Me

i think its the error ->Unload Me
try to put that code before the end sub

Anonymous
hi!

can you tell me what is the exact error?

cidfrey's picture
User offline. Last seen 1 week 13 hours ago. Offline
Joined: 12/17/2009
Use For for the start of

Use For for the start of looping and Next for the back end.

Don't have much idea about sa gusto mo magyari kse ndi ka naman nagpost ng codes kung san ilalagay ung loop

System Developer
Contacts :
09087076539
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal

Anonymous
re:

example of for loop

dim i as integer
for i=1 to listview.columnheaders.count
combobox.additem listview.columnheaders(i).text
next i

this code will add the text in each columnheader of the listview control in the combobox. this is for search tool of your projects..
tnx

leomar ramos

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
re

ok tnx i'll try to make your suggestion

=>> Lynesus <<==

User offline. Last seen 1 day 9 hours ago. Offline
Joined: 01/25/2010
looping problem

hi can u help me in looping statement

=>> Lynesus <<==

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Step by Step Java Tutorial

In this tutorial you will learn how to program with Java. It has a rich of information to be educated well with Java.

Read more...

Do You Have Question?

Do you have any question related to computer programming? Visit our forum and post new topic on the category you like. Be gentle when asking a question.

Ask now...

Point of Sale

Point of Sale is very useful especially for supermarkets or restaurants. I have included a barcode scanner in this program. Please check it out.

Read more...