Recordsetclone

Tallbloke

Registered User.
Local time
Today, 04:13
Joined
Aug 17, 2006
Messages
66
I have the following bit of VBA which works like a charm :

Code:
With CallNotes.Form.RecordsetClone
         .AddNew
              !CustomerRef = Me!CustomerRef
              !Who = Forms.markswitchboard!Text52
              !Date = Now()
              !Notes = "Final Deposit Due on" & " " & FinalDepositDueDate
              !DiaryDate = FinalDepositDueDate + 1
         .Update
End With

However, if I try to use this code on a different tab control it just doesn't work.

I get Runtime Error 424 object required.

I guess I am asking how to reference one subform from another?
 
Ah...got it! Posting here always helps :)

Code:
With Forms!Customer!Payments.Form.RecordsetClone

End With
 
Another way to refer to another subform on the same main form:

Me.Parent.othersubformcontrol etc.

This has the advantage of working wherever the subforms are located instead of relying on the reference via the Forms Collection.
 

Users who are viewing this thread

Back
Top Bottom