- This topic has 304 replies, 5 voices, and was last updated 2 years ago by mauricem.
-
AuthorPosts
-
August 13, 2021 at 2:58 pm #94937ghostrideroftheniteMember
I’m getting close to having the trivia work , got it so questions and answers are linked and for now using a next button shows next question trying to figure out the loop method and 45 sec delay between questions and posting correct answer if not answered and point scoring all that hahah so still alot to do
August 13, 2021 at 4:03 pm #94941ghostrideroftheniteMemberthing im exploreing some these
http://allenbrowne.com/ser-29.html
Microsoft Access tips: VBA Traps: Working with RecordsetsMicrosoft Access tips: VBA Traps: Working with Recordsets
Common mistakes developers make when working with Recordsets in a Microsoft Access database
5. MoveNext without testing EOF
A MoveNext may take you to the end of the recordset (EOF) or a MovePrevious to the beginning of the recordset (BOF). Failure to test for these conditions means your code works for most cases, but generates an error one day when the last/first record is accessed.
The problem is prevalent when you have another exit condition in mind for your loop, so you are not thinking of EOF. Test for EOF (or BOF if moving backwards) before checking the real exit condition for your loop.
Solution:Use this construct for looping through Access recordsets:
Do while Not rst.EOF If rst![MyField] <> Something Then 'The real loop exit condition. Exit Do End If ' Rest of your code here. rst.MoveNext Loop
and
Another solution would be to use a timer control. You could set the time to 30000 msecs
and enable the timer. In the Timer_Timer() event you will disable the timer.
In your code you need a line to wait for the disabled timer.
Assume Timer1 added to your form
Code:Private Sub Timer1_Timer() Timer1.Enabled = False End Sub
‘in your code loop
…
While Timer1.Enabled: DoEvents: Wend ‘wait for the timer to expireor this possibily
For the sake of a complete set of solutions:
If you’re using vb6 in an application environment (like excel), you can use
Application.OnTime (now + TimeValue(“00:00:30”)), “ProcedurePart2”
to call a procedure (with no parameters) after 30 seconds without locking up the application or consuming CPU power.
This would, for instance, work in any VBA environment. Depending on the nature of your VB6 app (standalone vs add-on), this option may be available to you.
Public Sub delay(PauseTime as integer) Dim start As single start = Timer Do While Timer < start + PauseTime If (Timer < start) Then 'midnight crossover start = start - (86400 + 1) End If DoEvents ' Yield to other processes. Loop End Sub
August 14, 2021 at 9:43 am #94965AdminAdministratorNice, for most of your code I really need time to understand it 🙂 So basically all you need from me is to connect and un-connect from the Paltalk’s rooms?
And sorry for my late replies, Summers in NY I am almost neva home lolAugust 14, 2021 at 4:30 pm #94997ghostrideroftheniteMemberNy lol I’m in upstate Ny, Well Yes I need connect and exit Paltalk but also how to post timer in room and when trivia finished how to post in room and accept responses and award points and the like
August 14, 2021 at 6:25 pm #95005ghostrideroftheniteMemberintersting so now on classic paltalk if ya view cams they dc you hahahah
August 16, 2021 at 3:14 pm #95091ghostrideroftheniteMemberi think dis is part of the codes for the trivia i need just trying figure out how make work Use this construct for looping through Access recordsets:
Do while Not rst.EOF If rst![MyField] <> Something Then 'The real loop exit condition. Exit Do End If ' Rest of your code here. rst.MoveNext Loop
This would, for instance, work in any VBA environment. Depending on the nature of your VB6 app (standalone vs add-on), this option may be available to you.
Public Sub delay(PauseTime as integer) Dim start As single start = Timer Do While Timer < start + PauseTime If (Timer < start) Then 'midnight crossover start = start - (86400 + 1)
August 17, 2021 at 11:20 am #95119AdminAdministratorYeps 🙂 okay next week I should have more time so we can work on it.
August 17, 2021 at 1:18 pm #95124ghostrideroftheniteMemberok I’m still working trivia almost working and have meeting robin tonite help finish it hopefully I created a local form as test run see it works then would need that work in paltalk
August 18, 2021 at 3:30 pm #95195ghostrideroftheniteMembersome how this code not correct – I created Form5 as trial form to simulate a paltalk room so to run and answer questions but the code only brings the answer into the text box for question and answer does not bring in the actual answer
Form4 Private Sub Text2_Change() Load Form5 Set Form5.txtTest = Text2 Form5.Show End Sub Private Sub Text3_Change() Load Form5 Set Form5.txtTest = Text3 Form5.Show End Sub Form5 Public txtTest As TextBox Private Sub Form_Activate() Text1.Text = txtTest.Text Text6.Text = txtTest.Text End Sub Private Sub Text2_Change() txtTest.Text = Text1.Text End Sub Private Sub Text6_Change() txtTest.Text = Text6.Text End Sub
August 19, 2021 at 9:41 am #95242ghostrideroftheniteMemberwonder if change code to this for the textbox respectively would work might try it lol
(form1) private sub command1_click () me.hide form2.show form2.textbox1.text = me.textbox1.text end sub (form2) private sub command1_click () me.hide form1.show form1.textbox1.text = me.textbox1.text end sub
August 19, 2021 at 10:07 am #95243ghostrideroftheniteMemberlol couldnt make that work either i’m missing something
August 19, 2021 at 11:18 am #95246ghostrideroftheniteMemberAugust 19, 2021 at 1:17 pm #95251ghostrideroftheniteMemberforget that one i uploaded wrong version left out form 5
heres one im working on
https://www.dropbox.com/s/ycuw25i06r92tlm/NewBot%20Project%20files.zip?dl=0August 21, 2021 at 3:52 pm #95377ghostrideroftheniteMemberReinstalled 806 classic right from Paltalk and now it works again with all cams and no dc hahahha
August 23, 2021 at 5:29 am #95477ghostrideroftheniteMemberI wonder if using this (with changes to correct text and forms will work)
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged Form2.TextBox1.Text = TextBox1.Text End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Form2.Show() End Sub
-
AuthorPosts
Related
- You must be logged in to reply to this topic.