Ok, here is my issue guys :
I have a Customer form with CustomerID and CustomerName textbox on it, then i have a Building_SubFrom displayed as Datasheet underneath those text boxes. I have create View Building Info Button in the header of the Customer from, which opens up Building_Information Form. However, the issue that i cant figure out is how to make the button outside Building_Subform to populate Building_Information Form based on its information. I have no trouble doing it differently, but i really want to follow this design format.
I have tried this code, which works fine for just opening the form:
Private Sub cmd_ViewBuildingInfo_Click()
Me.Building__Subform.SetFocus
DoCmd.OpenForm "Building_Information"
End Sub
However, the code (which i though would be appropriate) gives me an error:
Private Sub cmd_ViewBuildingInfo_Click()
Me.Building__Subform.SetFocus
DoCmd.OpenForm "Building_Information", , , "BuildingID = & " & Me.BuidingID
End Sub
I know the problem is that Vba cant find contol Me.BuildingID, which is the part of Buidling_Subform, so i though SetFocus on this form would solve the problem, however it does not.
Please suggest
Regards
Evgeny