Bronte1226
Technical User
I have a list box on a form that I am hoping will allow users to select the record from the box and it will open another form displaying the details of that record.
So far, I have been able to populate the list and get it to open the form I want it to successfully. The problem lies in linking the correct record.
When the record loads in the second form, the particular data field that I linked it with shows the correct information. However, it doesn't seem to be pulling the entire corresponding record's information. Nothing else is correct. What am I doing wrong?
Here is my code:
Private Sub List6_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Vendor Name] = '" & Me![List6] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub OpenRecord_Click()
On Error GoTo Err_OpenRecord_Click
Dim strFormName As String
Dim stLinkCriteria As String
strFormName = "frm_vendor_name"
DoCmd.OpenForm strFormName, , , , , , Me.List6
Exit_OpenRecord_Click:
Exit Sub
Err_OpenRecord_Click:
MsgBox Err.Description
Resume Exit_OpenRecord_Click
End Sub
Beyond frustrated here! Please help!
So far, I have been able to populate the list and get it to open the form I want it to successfully. The problem lies in linking the correct record.
When the record loads in the second form, the particular data field that I linked it with shows the correct information. However, it doesn't seem to be pulling the entire corresponding record's information. Nothing else is correct. What am I doing wrong?
Here is my code:
Private Sub List6_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Vendor Name] = '" & Me![List6] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub OpenRecord_Click()
On Error GoTo Err_OpenRecord_Click
Dim strFormName As String
Dim stLinkCriteria As String
strFormName = "frm_vendor_name"
DoCmd.OpenForm strFormName, , , , , , Me.List6
Exit_OpenRecord_Click:
Exit Sub
Err_OpenRecord_Click:
MsgBox Err.Description
Resume Exit_OpenRecord_Click
End Sub
Beyond frustrated here! Please help!