Create form and controls using vba

Joined
Jul 7, 2015
Messages
1
Reaction score
0
Hello,

i have code
Sub DisplayNum()

Dim con1 As ADODB.Connection
Dim recset1 As ADODB.Recordset
Dim lngNum1 As Long
Dim lngNum2 As Long
Dim lngNum3 As Long

Set con1 = CurrentProject.Connection
Set recset1 = New ADODB.Recordset
recset1.Open "tblBumber", con1

lngNum1 = recset1.Fields("NumberStart")
lngNum2 = recset1.Fields("NumberToPrint")
lngNum3 = recset1.Fields("NumberStart") + recset1.Fields("NumberToPrint")

Do Until lngNum1 > lngNum3
Debug.Print lngNum1 + 1
lngNum1 = lngNum1 + 1
Loop

recset1.Close
con1.Close

Set recset1 = Nothing
Set con1 = Nothing
End Sub

if you run this code it will show the result in the immediate window. How to create a form and controls to hold the result show in the immediate window?

Thank you
 
Last edited:
Back
Top