Hi Guys,
I have a problem with a pretty simple little databse I am putting together, which I hope someone on here would be able to help me with.
Basically, I have a form that is based partially on a query, which I want to requery whenever they click "done". However that particular record will not longer be in the recordset so I cannot use the current ID as the reference to go back to after the requery. So the sequence would be to 1. look at the current record and remember that position (not the ID name as it will be different after the requery), 2. Requery the form, 3 go to that record on the form.
I have been struggling to get the code to work though. What I have so far though is:
'update the table with the latest result
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim lngPK As String
Set db = CurrentDb
Set rs = db.OpenRecordset("T_setups")
With rs
.AddNew
![Customer ID] = Me!Customer_ID
![Advisor] = Forms![Main]![Agent_filter]
![Call 1 date] = Me!Date
![Call 1 outcome] = Me!Outcome
![Resolved] = Me!Resolved
![Notes] = Me!Notes
![telephone] = Me!telephone
![Terminal type] = Me!TerminalType
.Update
End With
Me.Requery
Me!Notes = ""
Me!Resolved = False
Me!Outcome = ""
End Sub
As you can see though, with this it just keeps going back to record one after each requery. One of the criteria of the query is that this ID does not exist in the T_setups_ table, so after each requery, this one will disappear. I am also struggling with making changes via the DOA recordset and making the actual form go to that record thorugh the docmd.gotorecord method.
Anyway, any help or advise you can offer will be greatly appreciated.