Hi all,
its day two of my struggle. I am trying to find a solution and its just driving me mad. Here is my situation:
Now Here is a piece of my code:
1) Establishing Temp Vars and opening the form (frmEditProject):
2) Opening the form frmProjectInfo to a record based on tempVar![ProjectGPN]:
3) Opening the form frmEnquiryNav to a record based on temvar![EnquiryNo]:
4) and now that the part I have problems with (not for the first time, last time I just changed the design). frmEnquiryNav is a Navigation form with Subforms obviously. I would like to navigate to specific record related to the project, based on the EnquiryNo. My code is in different variants (here seen for different subforms), none of it is working:
I am not sure if im working from the main form, or the sub form, should I be addressing it in an absolute or relative way, where should I start?
I have tried to make sense of it using those site:
http://www.btabdevelopment.com/ts/ewtrhtrts
http://ss64.com/access/syntax-references.html
http://access.mvps.org/access/forms/frm0031.htm
Both Control Names are "NavigationSubform".
I like my keyboard, please don't let me break it :banghead:
its day two of my struggle. I am trying to find a solution and its just driving me mad. Here is my situation:

Now Here is a piece of my code:
1) Establishing Temp Vars and opening the form (frmEditProject):
Code:
Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria2 As String
Dim tmp As String
tmp = [SearchResults].[Column](12)
stDocName = "frmEditProject"
stLinkCriteria = "[ProjectGPN]=""" & Me![SearchResults] & """"
stLinkCriteria2 = "[EnquiryNo]=""" & tmp & """"
TempVars.Add "CurrentEnquiryNo", stLinkCriteria2
TempVars.Add "ProjectGPN", stLinkCriteria
DoCmd.OpenForm stDocName
2) Opening the form frmProjectInfo to a record based on tempVar![ProjectGPN]:
Code:
Private Sub Form_Load()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmProjectInfo", _
PathToSubformControl:="frmEditProject.NavigationSubform", _
WhereCondition:=TempVars![ProjectGPN], _
Page:="", _
DataMode:=acReadOnly
End Sub
Code:
Private Sub NavigationButton7_Click()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmEnquiryNav", _
PathToSubformControl:="frmEditProject.NavigationSubform", _
WhereCondition:=TempVars![CurrentEnquiryNo], _
Page:="", _
DataMode:=acReadOnly
End Sub
Code:
Private Sub frmEnquiryCustomer_Click()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmEnquiryCustomer", _
PathToSubformControl:="frmEditProject.Form!frmEnquiryNav!NavigationSubform", _
WhereCondition:=TempVars![CurrentEnquiryNo], _
Page:="", _
DataMode:=acReadOnly
'Me!Subform1.Form!Subform2.Form!ControlName
End Sub
Private Sub frmEnquiryDetails_Click()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmEnquiryDetails", _
PathToSubformControl:="Forms!frmEditProject!NavigationSubForm.Form!NavigationSubform", _
WhereCondition:=TempVars![CurrentEnquiryNo], _
Page:="", _
DataMode:=acReadOnly
'Forms![main form name]![subform control name].Form![nested subform control name].Form![control name]
'Forms!frmMain!Subform1.Form!Subform2.Form.
End Sub
Private Sub frmEnquiryInfo_Click()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmEnquiryInfo", _
PathToSubformControl:="frmEnquiryNav.NavigationSubform", _
WhereCondition:=TempVars![CurrentEnquiryNo], _
Page:="", _
DataMode:=acReadOnly
End Sub
I am not sure if im working from the main form, or the sub form, should I be addressing it in an absolute or relative way, where should I start?
I have tried to make sense of it using those site:
http://www.btabdevelopment.com/ts/ewtrhtrts
http://ss64.com/access/syntax-references.html
http://access.mvps.org/access/forms/frm0031.htm
Both Control Names are "NavigationSubform".
I like my keyboard, please don't let me break it :banghead: