Go To Record on Main Form From Double-Click on Unbound Subform (1 Viewer)

JJFernandez

Registered User.
Local time
Today, 03:07
Joined
Oct 29, 2018
Messages
18
Hi all,

I'm not a power user of Access but I'm trying to accomplish something that seems easy in my mind but can't quite get it done.

I have a main form that has all of the main particulars of an 'enforcement incident'. I also have a subform that shows all of the incidents at once that I've created search boxes for in order to filter by incident type and suspect surname. It is unbound.

I would like to be able to double-click the Incident_ID of the record in the subform that I'd like to view on the main form to make edits.

I think this is what I'm trying to achieve although I keep getting a syntax error on the .FindFirst line

Private Sub Incident_ID_DblClick()
'reference the recordset of the form in which navigation is to occur
With Forms("INCIDENT REPORT FORM").Recordset
'run a findfirst against that recordset
.FindFirst "Incident_ID = " & Me.Incident_ID
'if item not found issue warning
If .NoMatch Then MsgBox Me.Incident_ID & " not found"
End With
End Sub

Any ideas what I might be missing? Btw the Incident_ID's are text as they are a combo of numbers and letters. Access 2010

Many thanks,

Jeremy
 

JJFernandez

Registered User.
Local time
Today, 03:07
Joined
Oct 29, 2018
Messages
18
Thanks a lot for that info about the text field delimiters, that did the trick.

Appreciate the help.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:07
Joined
Aug 30, 2003
Messages
36,130
No problem Jeremy and welcome to the site by the way!
 

Users who are viewing this thread

Top Bottom