Eric the Viking
Registered User.
- Local time
- Today, 00:14
- Joined
- Sep 20, 2012
- Messages
- 70
Dear All
More help needed if there is a solution.
I have a form with a list box on it. When I select a record it opens another form with the full record using the OnClick event with the following code:
Private Sub ListPts_Click()
On Error GoTo Err_ListPts_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm-Update patient details"
stLinkCriteria = "[Patient number]=" & Me![ListPts]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Dim setListPtsHeight As Integer
setHeight = 275
Me.ListPts.Height = setHeight
ListPts.RowSource = ""
Exit_ListPts_Click:
Exit Sub
Err_ListPts_Click:
MsgBox Err.Description
Resume Exit_ListPts_Click
End Sub
The subform lists all the recently viewed full records. What I want to try and get to happen is to add a line of code in the list box OnClick event that requeries the subform to pick up the record I have just opened with the list box OnClick event.
I have tried putting this code in at various points:
Forms![Find Patients]![frm-LastViewed].Requery
(Find Patients is the main form and frm-LastViewed the subform) but cant get the outcome I am looking for.
Any ideas?
Regards
Eric
More help needed if there is a solution.
I have a form with a list box on it. When I select a record it opens another form with the full record using the OnClick event with the following code:
Private Sub ListPts_Click()
On Error GoTo Err_ListPts_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm-Update patient details"
stLinkCriteria = "[Patient number]=" & Me![ListPts]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Dim setListPtsHeight As Integer
setHeight = 275
Me.ListPts.Height = setHeight
ListPts.RowSource = ""
Exit_ListPts_Click:
Exit Sub
Err_ListPts_Click:
MsgBox Err.Description
Resume Exit_ListPts_Click
End Sub
The subform lists all the recently viewed full records. What I want to try and get to happen is to add a line of code in the list box OnClick event that requeries the subform to pick up the record I have just opened with the list box OnClick event.
I have tried putting this code in at various points:
Forms![Find Patients]![frm-LastViewed].Requery
(Find Patients is the main form and frm-LastViewed the subform) but cant get the outcome I am looking for.
Any ideas?
Regards
Eric