|
-
Apr 11th, 2011, 08:58 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Electronic Draw
Plz check my following code:
Code:
Private Sub cmdStop_Click()
MyRs.Close
Timer1.Enabled = False
MyRs.Open "select ename from Draw where pno='" & lblPNO.Caption & "'", MyConn, adOpenKeyset, adLockOptimistic
lblName.Caption = MyRs.Fields!Ename
MyRs.Close
End Sub
Private Sub Form_Load()
MyConn.Open "Draw"
MyRs.Open "select * from Draw", MyConn, adOpenKeyset, adLockOptimistic
End Sub
Private Sub Timer1_Timer()
lblPNO.Caption = MyRs.Fields!PNO
MyRs.MoveNext
If MyRs.EOF Then
MyRs.MoveFirst
End If
End Sub
This code works fine
Now I want to make the button for Start it again rather than i run the project again and again. Kindly guide how i make it
-
Apr 11th, 2011, 06:36 PM
#2
New Member
Re: Electronic Draw
Do the same as you did in form load and then enable the timer.
Last edited by nvbsoftware; Apr 11th, 2011 at 06:50 PM.
-
Apr 12th, 2011, 12:32 AM
#3
Re: Electronic Draw
Try moving the code in Form_Load to a new sub and call that sub whenever needed, ie. at startup and for the start button.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Apr 13th, 2011, 08:07 AM
#4
Thread Starter
Hyperactive Member
Re: Electronic Draw
I put my code in Start (which is sub routine) and call it through cmdStart, its work fine first time but if i press the stop button and again i click start button then it will give error:
Error No.3075
"Operation is not allowed when the object is open"
-
Apr 13th, 2011, 08:28 AM
#5
Re: Electronic Draw
Because you are opening the connection again eventhough you haven't closed it !
This is the line causing the problem:
Try closing the connection, when you press the Stop button.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Apr 14th, 2011, 07:18 AM
#6
Thread Starter
Hyperactive Member
Re: Electronic Draw
Thanks, let me check and confirm
-
Apr 19th, 2011, 06:32 AM
#7
Thread Starter
Hyperactive Member
Re: Electronic Draw
Yes, it is works correctly, thank you so much akhileshbc
Last edited by mcsmba1; Apr 20th, 2011 at 11:16 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|