CHR1S Posted July 9, 2012 Posted July 9, 2012 I have a macro that makes a displayed record click-able in turn opening the record in a new window for editing. If IsNull([AssetID]) Then Beep Edit If If Not IsNull([AssetID]) Then Open Form Assets Where Condition = = "[AssetID]" Window Mode Dialog OnError Go to Next Requery End It It works as expected when displaying a report, but when called from a form the macro always pulls record 1 despite the item clicked. All data is pulled from the same table using the same macro so in theory should just work. Cant for the life of me see why! Anyone else spot the error?
CHR1S Posted July 9, 2012 Author Posted July 9, 2012 Oh and the tag is - HyperlinkToDetails~FormName=Assets~SourceID=AssetID
CHR1S Posted July 9, 2012 Author Posted July 9, 2012 Argh! And now my reports have stopped displaying the clicked link and just show record 1! D'oh
CHR1S Posted July 11, 2012 Author Posted July 11, 2012 For anyone following I rewrote it as code instead of macro and it worked. Private Sub Text25_Click() Dim stDocName As String Dim stLinkCriteria As String stDocName = "Assets" stLinkCriteria = "[AssetID]=" & Me![AssetID] DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormEdit, acWindowNormal End Sub
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now