jesusoneez
IT Dogsbody
- Local time
- Today, 21:04
- Joined
- Jan 22, 2001
- Messages
- 109
I have a form with subform...they are not linked (the form shows the table data directly and the subform shows a query of the table).
The subform is set as a continuous form. I want to double-click on the unique field to open that record in the parent form.
I have something similar in another database, that when double-clicking on the unique field, it opens a seperate form for editing the record.
This is the code use for that:
Obviously I want to adapt this, and my first thought was to replace;
with;
But that didn't work and I can't find anything that'll work.
Any help (as usual) much appreciated.
The subform is set as a continuous form. I want to double-click on the unique field to open that record in the parent form.
I have something similar in another database, that when double-clicking on the unique field, it opens a seperate form for editing the record.
This is the code use for that:
Code:
Private Sub UserID_DblClick(Cancel As Integer)
Dim stDocName As String 'Target form name
Dim stLinkCriteria As String 'Link field on current form (UserID)
Dim UserID As String 'Linked field on target form (UserID)
stDocName = "frmBannedUserEdit"
stLinkCriteria = "[UserID]=" & "'" & Me.UserID & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_UserID_OnClick:
stDocName = vbNullString
stLinkCriteria = vbNullString
DoCmd.Close acForm, "frmBannedUserManagement"
End Sub
Obviously I want to adapt this, and my first thought was to replace;
Code:
DoCmd.OpenForm stDocName, , , stLinkCriteria
with;
Code:
Me.stDocName.Refresh, , , stLinkCriteria
But that didn't work and I can't find anything that'll work.
Any help (as usual) much appreciated.