Open a record in form based from a datasheet double click

andy_dyer

Registered User.
Local time
Today, 23:40
Joined
Jul 2, 2003
Messages
806
Ok - I am losing the plot!! :confused::confused:

I have this working in one part of my database and I think I'm using the same principles but cannot get it work in another part.

Where it works:

I have a parent form with annual totals on and a button which opens a detail form to add the data for new years which then refreshes on the annula totals form when it closes. If I want to go back into a year to view or amend I can click on a line in the datasheet which fires this code

Code:
Private Sub subfrmProjectFinanceYear_DblClick(Cancel As Integer)
Dim intFinanceYearID As Integer

    intFinanceYearID = Me.Parent.subfrmProjectFinanceYear.Value

DoCmd.OpenForm FormName:="frmProjectFinanceYearDetail", View:=acNormal, datamode:=acFormEdit, OpenArgs:=CStr(intFinanceYearID)

End Sub

Where it doesn't work;

I have my main forms which has a dynamic subform which pulls through different subforms based on button clicks on one of these subforms has a further nested subform which holds lists of the project partners and has a button to fire a seperate detail form to input partner details.

So I go from frmProjectMaster -> sfrData which displays frmProjectPartner and then opens frmProjectPartnerFinance to input the details

Code:
Private Sub subfrmProjectPartner_DblClick(Cancel As Integer)
Dim intProjectPartnerID As Integer

    intProjectPartnerID = Me.Parent!sfrData!subfrmProjectPartner.Value

DoCmd.OpenForm FormName:="frmProjectPartnerFinance", View:=acNormal, datamode:=acFormEdit, OpenArgs:=CStr(intProjectPartnerID)


End Sub

This second code does nothing... it compiles but does nothing not even open the form on the wrong partnerfinance record...

Why is this not doing anything... it must be down to the hierarchy of forms and how they are referenced but it has beaten me....


Any ideas?
 
Any ideas - before I lose my sleep dreaming in VBA? ;-)
 
Hi everyone - this is still rumbling on - any ideas?
 

Users who are viewing this thread

Back
Top Bottom