Using Recordset and saving changes (1 Viewer)

Mechele

Registered User.
Local time
Today, 04:16
Joined
Jan 25, 2002
Messages
121
I'm using a form with checkmarks to see if a record exist.
If the user clicks a topic, the computer will check to see if a record exist. If it doesn't, then a form, TPAForm, will open and the user will enter information on that form. The TPAForm's data source is a query TPAFormQuery.

If a record does exist than the form, TPAFormUpdate, will open and the user will update the information on the form. The TPAFormUpdate data source is a query TPAFormUpdateQuery.

My problem is that once the user creates a new record or make changes to the existing record, the new record or changes aren't saved. What am I doing wrong? I thought the rs.close would correct the problem since I'm closing the recordset and when the forms opens, they open based on criteria in the queries which is just to pull the fields from the underlying table of each query.

Private Sub TPACheck_Click()
Dim rs As Recordset
Dim db As Database
Dim strSQL3 As String

strSQL3 = "SELECT * FROM TPATable WHERE TPATable.ClientID = " & Me!UpdateTemp
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL3)
If rs.EOF And rs.BOF Then
rs.Close
DoCmd.Minimize
DoCmd.OpenForm "TPAForm"
Forms!TPAForm!ClientID = Forms!ClientUpdateMenuForm!UpdateTemp
Else
rs.Close
DoCmd.Minimize
DoCmd.OpenForm "TPAFormUpdate"
End If
End Sub:confused:
 

LNewton

Registered User.
Local time
Today, 04:16
Joined
Jan 24, 2002
Messages
31
Try a db.update or db.refresh this might help.
 

Mechele

Registered User.
Local time
Today, 04:16
Joined
Jan 25, 2002
Messages
121
Thank you! ::)
 

Users who are viewing this thread

Top Bottom