Sub-form reference failure

josephbupe

Registered User.
Local time
Today, 11:01
Joined
Jan 31, 2008
Messages
247
Original sample was provided by: ByteMyzer (AWF VIP)
In one of his sample (player) db, part of the code was as before:

If uMsg = MM_MCINOTIFY And wParam = MCI_NOTIFY_SUCCESSFUL Then
If CurrentProject.AllForms("frmTracks").IsLoaded = True Then
Forms("frmTracks").Form_CallBack
End If


I have just created another form and put the form ByteMyzer's form "frmTracks" as a subform. Unfortunately, the reference isn't working for me.

If uMsg = MM_MCINOTIFY And wParam = MCI_NOTIFY_SUCCESSFUL Then
If CurrentProject.AllForms("frmUnbound!frmTracks").IsLoaded = True Then
Forms("frmUnbound!frmTracks").Form_CallBack
End If
End If


But, when i only open the form "frmTracks" itself, the playing (reference) works well.

Some one help me with the correct sintax.

:confused:Josephbupe
 
The syntax is
CurrentProject.AllForms("FormName").IsLoaded.
I think that as far as the AllForms collection is concerned, the FormName is still just frmTracks, and not frmUnbound!frmTracks.

Otherwise, to reference the subform you would need to use
frmUnbound!frmTracks.Form
anyway. Without the .Form on the end, you are only referencing the control containing the subform and not the subform itself.
 
Thank you Kafrin. I will give it a try again.
 

Users who are viewing this thread

Back
Top Bottom