Hi Antonov
Not really sure if it's a good idea (or possible) to run the actions you
want from a report - I only use reports for viewing or printing - If it is
someone else will let you know.
Anyway, the basic function to open a form on double click would be to use
DoCmd.OpenForm. If used behind a form field it would look something like
this.
Private Sub SomeFieldName_DblClick(Cancel As Integer)
DoCmd.OpenForm "SomeFormName", acNormal, "", "", , acNormal
End Sub
Not that this would not filter the form as you want. To do this you need
to
"inform" access which record you want the form to open at by applying a
where
clause.
If you have a common field on both forms you can simply "link" them so
that
the new form opens with "that" form's data. Something like this (I have
use
the standard mesg box if there is an error but you can change this if you
need to)
Of course you can select the specific data that you want to "link" if this
is the case you would need to specify this data as
stLinkCriteria = "[WhatEverFieldInNewForm]=" & Me![WhatEverNameOn1stForm]
So the whole thing would look something like this
Private Sub SomeFieldName_DblClick ()
On Error GoTo Err_ SomeFieldName_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FormToOpen"
stLinkCriteria = "[FieldInNewForm]=" & Me![FieldOn1stForm]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ SomeFieldName_DblClick:
Exit Sub
Err_ SomeFieldName_DblClick:
MsgBox Err.Description
Resume Exit_ SomeFieldName_DblClick
End Sub
If you're not sure about coding then you could look at using a macro to
get
the results you want.
Hope this helps
--
Wayne
Manchester, England.
Enjoy whatever it is you do
antonov said:
Hello everybody, I have this report. When I double click on any of the
fields in this report I need the form Warehouse to open and to show the
record I've clicked on.... is it possible?
Thanks