Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

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?

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...