Hi All,
Interesting problem today.
I have a continuous form which shows a few main fields together with an image.
On a button in each record I have the following code -
which makes the selected record's ID match the MainForm's ID and causes the Mainform to display the corresponding full detail. It works fine.
Then, I wanted to use a small image of the selected plant in the continuous form to do the same. So, I copied the above code to the image_Click event (same form). It fails.
It doesn't get the ID of the selected record but it gets the ID of the top of the continuous form's recordsource.
Same code, same form, different control.
Any ideas why it should do that? And is there a way to reinforce the action to get the ID of the selected record?
Thanks
Interesting problem today.
I have a continuous form which shows a few main fields together with an image.
On a button in each record I have the following code -
Code:
Dim TempID As Integer
Forms!MainOptions!ID = Me!ID
TempID = DLookup("[ID]", "MainTable", "[LatinName]= " & Chr$(34) & Forms!PlantView!PlantViewSub.Form!LatinName & Chr$(34))
Forms!MainOptions!PlantList.Form.Recordset.FindFirst "ID = " & TempID
which makes the selected record's ID match the MainForm's ID and causes the Mainform to display the corresponding full detail. It works fine.
Then, I wanted to use a small image of the selected plant in the continuous form to do the same. So, I copied the above code to the image_Click event (same form). It fails.
It doesn't get the ID of the selected record but it gets the ID of the top of the continuous form's recordsource.
Same code, same form, different control.
Any ideas why it should do that? And is there a way to reinforce the action to get the ID of the selected record?
Thanks