I have a subform in datasheet view. I want to select a line and use one of the fields in this record to open another form with this field key in the "WHERE" of the SQL selection. I have the following code:
Dim strWhere As String
strWhere = "[FormNo] = " & Me.FormNo & " "
DoCmd.OpenForm "LIFE1209", acNormal, , strWhere
This works to open the form when I put it on one of the controls on the datasheet, but I want it to operate whenever I select a line on the datasheet. Which event will I put the above code into? I have tried on the Selection event in the Detail section to no avail,
Thanks in advance,
Groengoen
Dim strWhere As String
strWhere = "[FormNo] = " & Me.FormNo & " "
DoCmd.OpenForm "LIFE1209", acNormal, , strWhere
This works to open the form when I put it on one of the controls on the datasheet, but I want it to operate whenever I select a line on the datasheet. Which event will I put the above code into? I have tried on the Selection event in the Detail section to no avail,
Thanks in advance,
Groengoen