N
niuginikiwi
Hi,
I have a button called btnEdit on the header section of a continuous form.
In the details section I have the details based on a query. (they are
planting details)
What I have have got happening at the moment is I click on btnEdit and it
opens another form (frmPlanting) and finds the record that is in focus on the
first form (continuous form) based on the PK (PlantingID) of the record.
Here is the code on btnEdit that does that:
Private Sub btnEdit_Click()
'View Plantings filtered to the current ID
DoCmd.OpenForm "frmPlanting"
If Me![PlantingID] > 0 Then
DoCmd.GoToControl "PlantingID"
DoCmd.FindRecord Me![PlantingID]
Else
If Not IsNull(Forms![frmPlanting]![PlantingID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
End If
End If
End Sub
But instead of brining up everything on the next form (frmPlanting) when
finding and displaying the record in focus, I want to filter the only record
in focus on the first form and have that only displayed in the next form.
It must be easy doing that but I am stuck. How do I achieve that?
Any help would be much appreciated.
I have a button called btnEdit on the header section of a continuous form.
In the details section I have the details based on a query. (they are
planting details)
What I have have got happening at the moment is I click on btnEdit and it
opens another form (frmPlanting) and finds the record that is in focus on the
first form (continuous form) based on the PK (PlantingID) of the record.
Here is the code on btnEdit that does that:
Private Sub btnEdit_Click()
'View Plantings filtered to the current ID
DoCmd.OpenForm "frmPlanting"
If Me![PlantingID] > 0 Then
DoCmd.GoToControl "PlantingID"
DoCmd.FindRecord Me![PlantingID]
Else
If Not IsNull(Forms![frmPlanting]![PlantingID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
End If
End If
End Sub
But instead of brining up everything on the next form (frmPlanting) when
finding and displaying the record in focus, I want to filter the only record
in focus on the first form and have that only displayed in the next form.
It must be easy doing that but I am stuck. How do I achieve that?
Any help would be much appreciated.