G
Guest
Hello and thanks in advance for any help.
frmCompanies
sfrCompContactDetail
sfrCompContactList
frm Companies contains both subforms, not nested
When the Last Name field of the List sub is double clicked, I would like the
record in the Details sub to change to that record. Here's my code:
***
Dim lngCurrent As Long
Dim strSQL As String
lngCurrent = Me.ContactID.Value
strSQL = "SELECT * FROM tblContacts "
strSQL = strSQL & "WHERE tblContacts!ContactID = " & lngCurrent
Dim objfrmList As AccessObject
Set objfrmList = CurrentProject.AllForms("sfrCompContactDetail")
objfrmList.Recordset = strSQL
***
When I run this, I get Error 438, Object doesn't support this method or event.
It debugs to the objfrmList.Recordset = strSQL line
I've also tried objfrmList.Recordset (strSQL) and
Forms.sfrCompContactDetail.Recordsource = strSQL
and a few others
In all cases that particular line throws the same error.
Being self taught, I'm assuming I either missed something very simple, or I
have the entire wrong concept on how to mainuplate the record.
Any advice greatly appreciated,
Jack
frmCompanies
sfrCompContactDetail
sfrCompContactList
frm Companies contains both subforms, not nested
When the Last Name field of the List sub is double clicked, I would like the
record in the Details sub to change to that record. Here's my code:
***
Dim lngCurrent As Long
Dim strSQL As String
lngCurrent = Me.ContactID.Value
strSQL = "SELECT * FROM tblContacts "
strSQL = strSQL & "WHERE tblContacts!ContactID = " & lngCurrent
Dim objfrmList As AccessObject
Set objfrmList = CurrentProject.AllForms("sfrCompContactDetail")
objfrmList.Recordset = strSQL
***
When I run this, I get Error 438, Object doesn't support this method or event.
It debugs to the objfrmList.Recordset = strSQL line
I've also tried objfrmList.Recordset (strSQL) and
Forms.sfrCompContactDetail.Recordsource = strSQL
and a few others
In all cases that particular line throws the same error.
Being self taught, I'm assuming I either missed something very simple, or I
have the entire wrong concept on how to mainuplate the record.
Any advice greatly appreciated,
Jack