Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving to certain record

Status
Not open for further replies.

jcpelejo

Programmer
Jul 29, 2001
70
US
Hello. I have a query subform that shows results from information entered in some text boxes on the main form. I would like to find a way to double-click on the claim number field in the query subform and it moves the record to the claim number specified on the subform. For example, I have a form called "Manual Claims System - MR Canada." On that form, it has a textbox called ClaimNumber. I also have another form called "Search Form." On the "Search Form", I have a subform called "Search Query Subform." On the subform, there are the query results. One of the query result fields is ClaimNumber. When I double click on that field, I would like the textbox on the "Manual Claiims System - MR Canada" to be in synch with the result that was double clicked. Please advise. Life is too short to waste...
Julius Pelejo
jcpelejo@hotmail.com
 
Here is a double click event I use on a subform embedded withing a Search form. Works like this.

On "MyMainForm" I have a button which opens up the multi-field search form called "MySearchForm"

Embedded withing MySearchForm is a subformed named MySearchFormSubForm. User types in a few strings, and through other code generates the results that show up in the subform. User then double-clicks on subform and shifts the recordset in the Mainform to the record they click on; and at the same time shuts down the MySearchForm. Its easy enough, I think this might help.

Private Sub Form_DblClick(Cancel As Integer)
'filter search criteria according to user input...
'this routine uses the RecordsetClone property of the form to take advantage of the FindNext method following user input...
Dim MySet As Recordset
Dim StrCriteria As String
StrCriteria = "[ID] Like'*" & Forms![MySearchForm].Form![MySearchFormSubform]![ID] & "*'"
Set MySet = Forms![MyMainForm].RecordsetClone
MySet.FindFirst StrCriteria
Forms![MyMainForm].Bookmark = MySet.Bookmark
Forms![MyMainForm].Visible = True
DoCmd.Close acForm, "MySearchForm"
End Sub
 
This one is a very short one which works allright for me

Private Sub baan_DblClick(Cancel As Integer)
Dim stLinkCriteria As String
stLinkCriteria = "[BaanID]=" & Me![BaanID]
DoCmd.OpenForm "Baan", , , stLinkCriteria
End Sub
 
Thank you Isadore and Kweker. Your codes were very helpful. Life is too short to waste...
Julius Pelejo
jcpelejo@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top