set form to current record when opened in access 2007

I have a form that lists records in my data table. From this form I can open another form for more details. When I select open on the current record the details form opens blank. I am not sure what it is I am over looking.

My main form is named List. I have a textbox named txtopen with a control source value of =IIf(IsNull([ID]),"(New)","Open"). I created a on click envent macro as follows.

Condition                        Action                            Arguments
                                      onError                              Next,
[Form].[Dirty]                  RunCommand                    SaveRecord
[MacroError].[Number]   MsgBox                            =[MacroError].[Description], Yes, None,
...                                    StopMacro
                                        OnError                            Fail,

                                       OpenForm                Details, Form, , ="[ID]=" & Nz([ID],0), , Dialog  
Not IsNull([ID])                 SetTempVar             CurrentID, [ID]
IsNull([ID])                       SetTempVar               CurrentID, Nz(DMax("[ID]",[Form].[RecordSource]),0)
                                 SearchForRecord   Form, Mediation List, First, ="[ID]=" & [TempVars]![CurrentID]
                                  RemoveTempVar       CurrentID

Any help or advice would be greatly appreciated.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You shouldn't need to Requery or SearchForRecord. Your OpenForm action should show you the record you wish, assuming there is only one record for each ID value

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
genadianAuthor Commented:
I removed the entries from the macro and saved the form. All is well now.

Thank you,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.