Report button to pull ID

kit_sune

Registered User.
Local time
Today, 14:04
Joined
Aug 19, 2013
Messages
88
Is this possible? I had this idea just now. I built a report that provides all of the open support tickets. My idea is to have a button (Which I called "WorkIssue_Button") that displays beside each record that is populated on the report... I need this button to be able to pull the ID number of the record (Called "ID"). I then plan on opening a form that is preloaded to this record.

I just need to figure out how to pull that information... I might be able to figure out the rest.
 

The first example worked as advertized, but I decided that I do want my users to be able to navigate the other records in the table still.

So I followed the link on that page to the second part "still include all records" and I am runing into an error - perhaps I'm not putting in the form name correctly? Here's how I input it:
Code:
Private Sub WorkIssue_Button_Click()
'DoCmd.OpenForm "TechSupport_Form", , , "ID= " & Me.ID
Dim rs As Object
Dim lngBookmark As Long
'set a variable to the current record
lngBookmark = Me.ID
'open the new form
DoCmd.OpenForm "TechSupport_Form"
'take it to the selected record
Set rs = Forms!TechSupport_Form.RecordsetClone
rs.FindFirst "ID = " & lngBookmark
Set rs = Nothing
End Sub

The name of each control on the report/form is called "ID"
 
What's the error, and on what line? You missed this line, which would be after the FindFirst line:

Forms!TechSupport_Form.Bookmark = rs.Bookmark
 
Grr, I must have deleted it, thinking it was part of the optional code.

Thanks Paul you're awesome! That's the second time your website has helped me out.

Instead of moving to the next record I'm going to have it check to see if the record is still in an "open" status, and if not, pop a message saying to choose another record, then requery the report (which would remove all closed job).

Thanks again,

~Kit
 

Users who are viewing this thread

Back
Top Bottom