Requery form

swmorin

Registered User.
Local time
Today, 01:33
Joined
Jan 10, 2012
Messages
66
I have a form that shows information about a course. if you click on the "edit course info button" a pop appears to edit the info once you edit and hit submit the update query runs and then the original for should requery but it does not.

here is the requery code
Code:
Forms!frm_createcourseverify.requery

And here is the code for the form that should requery

Code:
Private Sub Form_Load()
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("select * from tbl_courses")
rs.MoveLast
Me.courseid = rs![courseid]
Me.Text7 = rs![COURSENUM]
Me.Text3 = rs![COURSEDATE]
Me.Text5 = rs![COURSEBLOCKS]
Me.Text1 = rs![COURSETITLE]
Me.Text9 = rs![COURSEDAYS]
Me.Text11 = rs![COURSEHOURS]

End Sub
 
From the looks of your code your form is an unbound form. You cannot just requery an unbound form. You will need to execute the same code that populated the text boxes from the results of the recordset provided by the sql statement.

Just run that code again to repopulate the form.
 
so do i just type the same code in the form? or is there a way for me to retrigger the on load event?
 

Users who are viewing this thread

Back
Top Bottom