Well, you should do a check to see which value isn't null and then change the recordsource of the subform accordingly, like so...
if not isnull(me!Name) then
me!SubForm_Name.Form.Recordsouce = "SELECT * FROM [Table_or_Query_Name] WHERE Name='" & me!Name) & "'"
elseif not isnull(me!ID) then
me!SubForm_Name.Form.Recordsouce = "SELECT * FROM [Table_or_Query_Name] WHERE ID=" & me!Name)
else
msgbox "Sorry, you must enter either a Name or ID"
end if
That should do it for you. Also, if you want either Name or ID to take precedence in case both are entered then you should put that one first. In my example, if both name and ID are entered, then it will open by name. You can flop the two to have it open by ID. Hope that helps for you.
Doug