I have Customer Form with Building subfrom with few buttons, which open up additional information about the building. It works fine in the single form view, but i would like to have my Building subform running as datasheet and use the same buttons to view additional information, however i dont seem to make it work. Here is the example code of one of the buttons:
This function opens up an Asset Register for particular building:
Private Sub cmdViewAsset_Click()
DoCmd.RunCommand acCmdSaveRecord
If Not IsNull(Me.txtBuildingID) Then
DoCmd.OpenForm "BuildingAssets", , , "BuildingID = " & Me.txtBuildingID
Else
MsgBox ("No Building Selected")
End If
It works with single form view, i guess i just need extra code to make it select the building from the datasheet, but i dont have sufficient vba knowledge to make it work.
any help would be much appreciated
regards