Macro to open form on specific record no longer working (1 Viewer)

Maleficent

Registered User.
Local time
Today, 14:12
Joined
Oct 25, 2016
Messages
21
I have a report which contains a "fieldID"

I also have a form which contains the same "fieldID"

I had set an openform macro on the report using where condition

[fieldID]=[Reports]![rptName]![fieldID]

to open the form at the corresponding record

it worked perfectly

then i mistakenly deleted the "fieldID" from the form.... i added it back in and now the macro no longer works? any ideas why this would be?

Thanks
 

Ranman256

Well-known member
Local time
Today, 09:12
Joined
Apr 9, 2015
Messages
4,339
you want forms. Open a report using the ID on the current form.
openreport "myReport",acViewPreview,, [fieldID]=[FORMS]![formName]![fieldID]

or in code:
docmd.openreport "myReport",acViewPreview,, "[fieldID]=" & me.fieldID
 

Users who are viewing this thread

Top Bottom