Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubForm Difference between 2000 and 2003

Status
Not open for further replies.

Prattaratt

Technical User
Aug 6, 2000
291
0
0
US
Were there any changes to the way subforms load between 2000 and 2003? The reason I ask is I have a problem that only occurs on 2003, but does not occur on my 2000 development system. The problem is I am trying to set subForm control values during loading, but on the 2000 system it says I have an invalid reference to the "Form" property. In the watch window, the property is not set, but on my 2000 system, it works just fine. Any clues as to how I can work around this? Here is the code in question:

Code:
Private Sub Form_Load()
  ExitByBtn (False)
  Me.TripNumber.Value = "0"
'  the next line is where it craps out on me.
  Me.BillingSubForm.Form.Controls("TripNum").Value = 0
  Me.Payment_Subform.Form.Controls("TripNum").Value = 0
  Me.BillingSubForm.Form.Filter = "[TripNum] = '0'"
  Me.BillingSubForm.Form.FilterOn = True
  Me.Payment_Subform.Form.Filter = "[TripNum] = '0'"
  Me.Payment_Subform.Form.FilterOn = True
  Me.Consignee.Form.Filter = "ID = 0"
  Me.Consignee.Form.FilterOn = True
End Sub
 
No there should not be any differences, the form object stayed the same.

Just to verify something. Prior to the error line type
msgbox Me.BillingSubForm.controlType

Should return 112. If it returns something other than 112 it tells me it is not a subform control. If it errors it tells me you do not have a control with that name. If it does not error then there is some kind of bug.
 
Okay, that problem is solved. I had a linked table reference which the billing subform relied on that apparently was invalid. Since the Data source was invalid, the subform would not open thereby causing the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top