G
George Philip
I'm new to using Form Class Modules.
I created a bound form that describes Contacts in a way that emulates Outlook
(with address and name parsing that works reasonably).
I can invoke the form in a module and specify a RecordSource; it permits me
to scroll around in the specified RecordSource. This is good.
Problem:
I have separate form that looks like a list; it has a button for each record
in the list.
The idea is to invoke the Contacts form and move the record pointer to the
record corresponding to the button in the list-form. If I were not using the
class module, I would use DoCmd.OpenForm with link criteria.
How do I do same with ClassModule?
I've tried Filter, Find, and Seek with negative results.
Also, and this may be tricky, I want user to be able to scroll thru Contact
Form record set once he/she invokes Contact Form. (i.e., I think filter is
wrong approach).
Here is some code I'm playing with: (Later, I'll replace 26 with a variable)
Private oSubcontractorName As [Form_frmContacts - Generic]
Private Sub butOpenSubcontractorForm_Click()
Set oSubcontractorName = New [Form_frmContacts - Generic]
With oSubcontractorName
.RecordSource = "tblSubcontractors"
' .Recordset.Find "Customer_Id = '26'"
.Filter = "oSubcontractors.Customer_ID = '26'"
.ContactFolderCaption = "Subcontractor"
.Visible = True
End With
Thanks in advance for your help.
George Philip
I created a bound form that describes Contacts in a way that emulates Outlook
(with address and name parsing that works reasonably).
I can invoke the form in a module and specify a RecordSource; it permits me
to scroll around in the specified RecordSource. This is good.
Problem:
I have separate form that looks like a list; it has a button for each record
in the list.
The idea is to invoke the Contacts form and move the record pointer to the
record corresponding to the button in the list-form. If I were not using the
class module, I would use DoCmd.OpenForm with link criteria.
How do I do same with ClassModule?
I've tried Filter, Find, and Seek with negative results.
Also, and this may be tricky, I want user to be able to scroll thru Contact
Form record set once he/she invokes Contact Form. (i.e., I think filter is
wrong approach).
Here is some code I'm playing with: (Later, I'll replace 26 with a variable)
Private oSubcontractorName As [Form_frmContacts - Generic]
Private Sub butOpenSubcontractorForm_Click()
Set oSubcontractorName = New [Form_frmContacts - Generic]
With oSubcontractorName
.RecordSource = "tblSubcontractors"
' .Recordset.Find "Customer_Id = '26'"
.Filter = "oSubcontractors.Customer_ID = '26'"
.ContactFolderCaption = "Subcontractor"
.Visible = True
End With
Thanks in advance for your help.
George Philip