JamesMcS
Keyboard-Chair Interface
- Local time
 - Today, 05:56
 
- Joined
 - Sep 7, 2009
 
- Messages
 - 1,819
 
Hi all, bit of an annoying one (aren't they all):
 
I'm getting the above error when changing link criteria for a subform in VBA.
 
My form has 4 subforms - two to select a level of detail that's displayed in the third and fourth:
Select_MH2 & Select_MH3 are the high level product category selectors.
MH3_Sub and Material Detail Subform are the ones that show the detail for the category selected in the first two.
 
In the on enters of Select_MH2 and Select_MH3(detail level select subforms) I've got the following:
	
		
MH3_Sub is the mid level detail form and Material Detail Subform is the line level detail subform.
 
I think it's something to do with the order I've got it in, but swapping them around doesn't seem to make a difference. Am I missing an instruction? Or is it in the wrong event? Might have a play with that now actually......
 
Weirdly the code doesn't hang on Select_MH3_Enter, only Select_MH2_Enter, i.e. when I click in Select_MH3, the subforms all work fine, but when I enter Select_MH2, it hangs on the highlighted line above....
 
Thanks in advance!
 I'm getting the above error when changing link criteria for a subform in VBA.
My form has 4 subforms - two to select a level of detail that's displayed in the third and fourth:
Select_MH2 & Select_MH3 are the high level product category selectors.
MH3_Sub and Material Detail Subform are the ones that show the detail for the category selected in the first two.
In the on enters of Select_MH2 and Select_MH3(detail level select subforms) I've got the following:
		Code:
	
	
	Private Sub Select_MH2_Enter()
MH3_Sub.SourceObject = "MH2 Mfr Overall Sub"
[COLOR=red][B]MH3_Sub.LinkMasterFields = ""[/B][/COLOR]
MH3_Sub.LinkChildFields = ""
 
MH3_Sub.LinkChildFields = "MH2"
MH3_Sub.LinkMasterFields = "MH2_Link"
 
[Material Detail Subform].LinkMasterFields = ""
[Material Detail Subform].LinkChildFields = ""
 
[Material Detail Subform].LinkMasterFields = "MH2_Link"
[Material Detail Subform].LinkChildFields = "MH2"
 
End Sub
 
----------------
 
Private Sub Select_MH3_Enter()
 
MH3_Sub.SourceObject = "MH3 Mfr Overall Sub"
 
MH3_Sub.LinkChildFields = ""
MH3_Sub.LinkMasterFields = ""
 
MH3_Sub.LinkMasterFields = "MH3_Link"
MH3_Sub.LinkChildFields = "MH3"
 
[Material Detail Subform].LinkMasterFields = ""
[Material Detail Subform].LinkChildFields = ""
 
[Material Detail Subform].LinkMasterFields = "MH3_Link"
[Material Detail Subform].LinkChildFields = "MH3"
 
End Sub
	I think it's something to do with the order I've got it in, but swapping them around doesn't seem to make a difference. Am I missing an instruction? Or is it in the wrong event? Might have a play with that now actually......
Weirdly the code doesn't hang on Select_MH3_Enter, only Select_MH2_Enter, i.e. when I click in Select_MH3, the subforms all work fine, but when I enter Select_MH2, it hangs on the highlighted line above....
Thanks in advance!
			
				Last edited: