Coba bang frangky dilengkapin aja jadi

Val("' & text1 & '") To Val("' & text2 & '")

Nambah kutip satu lag..mungkin disino masalahnya

Ato

Dideklarasiin aja dulu textboxnya, misal dim x = val(text1.text), y =
val(text2.text)

Lalu for-nya make x sebagai nilai awal dan y sebagai nilai kedua

Semoga membantu

 

Wassalam,

Mareta Mujiburrachman

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Frangky
Sent: Tuesday, November 28, 2006 3:48 PM
To: [email protected]
Subject: [Programmer-VB] Perintah For...Next bermasalah

 

Teman-teman yg terhormat!

 

Saya menggunakan code dibawah ini:

 

Private Sub Command1_Click()
    Dim i As Integer
    For i = 1 To 10
    Print i
    Next
End Sub

 

Dengan code diatas maka pada form akan tercetak 1 sampai 10.

 

Masalahnya setelah saya ubah code seperti dibawah ini, pada form hanya
tercetak Angka 0 (nol).

Padahal yang saya ingin harus tercetak angka 1 sampai 10, karena pada
text1 saya sudah input angka 1 dan pada text2 saya input angka 10. 

 

Private Sub Command1_Click()
    Dim i As Integer
    For i = Val(" & text1 & ") To Val(" & text2 & ")
    Print i
    Next
End Sub

 

=========================================================
This e-mail, including any attachment is confidential and may be privileged. 
Use or disclosure of it by anyone other than an intended adressee is strictly 
prohibited. If you are not an intended addressee, please notify the sender by 
telephone or e-mail and delete the e-mail and any attachment from your system.

PT Excelcomindo Pratama Tbk. ("the " Company") does not accept any liability in 
respect of communication made by its employee which is contrary to the company 
policy or outside the scope of the employment of the individual concerned. The 
employee responsible will be personally liable for any damages or other 
liability arising.
=========================================================

Kirim email ke