I downloaded the Split Form emulator (EmulateSplitForm v3accdb.)
It work fine but I had to change something and was wondering about this for some time.
It's about whether to use a '.' or a '!'
When I first pasted the code in from the On Load event and replaced the object names with mine,
I got an error when debugging.
Below is my code:
The first time I debugged it highlight 'frmContacts' saying Data member not found, When I changed the '.' to '!' It was fine.
I opened the original On Load and debugged but didn't get an error.
Why didn't I get the same error I got in my code??
Original code:
It work fine but I had to change something and was wondering about this for some time.
It's about whether to use a '.' or a '!'
When I first pasted the code in from the On Load event and replaced the object names with mine,
I got an error when debugging.
Below is my code:
Dim strSQL As String
strSQL = "SELECT tblContacts.* FROM tblContacts ORDER BY Listing;"
Me.RecordSource = strSQL 'set the recordsource of the main form
Me!frmContactsSub.SourceObject = "frmContactsSub" 'load datasheet subform w/ blank RecordSource
Set Me!frmContactsSub.Form.Recordset = Me.Recordset 'set subform recordset to same object as main form's
The first time I debugged it highlight 'frmContacts' saying Data member not found, When I changed the '.' to '!' It was fine.
I opened the original On Load and debugged but didn't get an error.
Why didn't I get the same error I got in my code??
Original code:
'This is the main form open event handler
Dim strSQL As String
strSQL = "SELECT ArchivedClasses.* FROM ArchivedClasses;"
Me.RecordSource = strSQL 'set the recordsource of the main form
Me.fsubArchivedClasses.SourceObject = "fsubArchivedClasses" 'load datasheet subform w/ blank RecordSource
Set Me.fsubArchivedClasses.Form.Recordset = Me.Recordset 'set subform recordset to same object as main form's