i can only click my button once per form load

Weresmytriple

Registered User.
Local time
Today, 21:55
Joined
Sep 5, 2013
Messages
58
hi all

i have created a button that works fine however it will only work one click per form load and i cant seem to figure out why.

here is my code any help will be much appreciated

Code:
Private Sub BntExpired_Click()
  
Dim QryAllCourses As recordset
Do Until ExpiryDate > Date Or ExpiryDate = ""
    MsgBox ([FirstName].Value + " " + [SecondName].Value + "'s course in " + [CourseName].Value + " has expired")
    recordset.MoveNext
Loop
Exit_BntExpired_Click:
    Exit Sub
Err_BntExpired_Click:
    MsgBox Err.Description
    Resume Exit_BntExpired_Click
End Sub

thanks

michael
 
You have not set the Recordset anywhere? How would the code even execute the first time? :eek:

When declaring objects, declare them as they are to avoid ambiguity. Like.
Code:
Dim someObj As [COLOR=Red][B]DAO.[/B][/COLOR]Recordset
 
i honestly have no idea how it works im not tat good at coding but it works. it just wont let me click it the 2nd time
 
Okay explain what you want to use the button for? In very simple English words with no Access/programming terminology.
 
basically to go through and bring up and text box saying which person and which courses have expired
 
actually just thought i can have a query do the exact same thign and open another form for it
 

Users who are viewing this thread

Back
Top Bottom