Me.SoftwareID = Forms![frm-Software Media Library].[SoftwareID] ??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

BeginOfCode ----------
Private Sub Form_Load()
Me.SoftwareID = Forms![frm-Software Media Library].[SoftwareID]
Me.SavePrintClose.Visible = False ' We don't want to se the print button until all data is filled in
Me.CheckOutDateTime.SetFocus ' This really is not needed because we disabled Name so focus is already here
End Sub
EndOfCode ------------

This code works fine when using a main form but How do I make it work using a sub form as the source?
 
Ronnie said:
BeginOfCode ----------
Private Sub Form_Load()
Me.SoftwareID = Forms![frm-Software Media Library].[SoftwareID]
Me.SavePrintClose.Visible = False ' We don't want to se the print button until all data is filled in
Me.CheckOutDateTime.SetFocus ' This really is not needed because we disabled Name so focus is already here
End Sub
EndOfCode ------------

This code works fine when using a main form but How do I make it work using a sub form as the source?


Depends on if [frm-Software Media Library] is the subform or
another form. Subforms are not members of the Forms
collection, so your reference above won't work for a
subform. To reference a subform's controls, properties or
methods, you must go through the subform **control** on the
main form.

If the code is in a completely separate form
Forms!mainform.subformcontrol.Form.[SoftwareID]

In the subform's mainform
Me.subformcontrol.Form.[SoftwareID]

From within the subform itself
Me.[SoftwareID]
 
Ronnie from what I see here it should be

me.softwareID = Forms![SoftByMfg]![SoftwareChkoutHist.Form]![SoftwareID]


That should call it from the subForm

Thomas

Ronnie said:
Im Not Sure I understand? So here is my example...
I have a main form called "SoftByMfg"
I have a sub form in the main form called "SoftWareChkOutHist"
So would I code the following
me.softwareID = me.SoftwareID
or
me.softwareID = Forms![SoftByMfg.SoftwareChkoutHist].[SoftwareID]
or


--
Sincere Thanks Ahead of Time


Marshall Barton said:
Ronnie said:
BeginOfCode ----------
Private Sub Form_Load()
Me.SoftwareID = Forms![frm-Software Media Library].[SoftwareID]
Me.SavePrintClose.Visible = False ' We don't want to se the print button until all data is filled in
Me.CheckOutDateTime.SetFocus ' This really is not needed because we disabled Name so focus is already here
End Sub
EndOfCode ------------

This code works fine when using a main form but How do I make it work
using a sub form as the source?


Depends on if [frm-Software Media Library] is the subform or
another form. Subforms are not members of the Forms
collection, so your reference above won't work for a
subform. To reference a subform's controls, properties or
methods, you must go through the subform **control** on the
main form.

If the code is in a completely separate form
Forms!mainform.subformcontrol.Form.[SoftwareID]

In the subform's mainform
Me.subformcontrol.Form.[SoftwareID]

From within the subform itself
Me.[SoftwareID]
 
Back
Top