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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-Time Error 2450

Status
Not open for further replies.

bostonfrog

Programmer
Jul 14, 2003
79
MX
I have read several posts here regarding this run-time error, but alas they haven't helped me. I am trying to insert a date from a popup-dialog into the date control of a subform. The button that inserts the date doesn't recognize the existence of the parent object --let alone worrying about the subform. I have tried coding this both explicity and implicitly, and it still doesn't recognize this "object referenced in Visual Basic Code."
Code:
cmdInsertDate_Click()
' SelectDate is the name given to the calendar control.
' sfrmAppointments is the subform.

Code:
Forms!frmPatients.sfrmAppointments!Date = SelectDate.Value
End Sub

VBA doesn't recognize the object reference to "frmPatients", which is the parent control. The name is correct, and there is no misspelling. The form's HasModule is set to "Yes".
 
bostonfrog:
If your subform is continous form, it wont work. The calendar control is and ActiveX control, therefore not supported by subforms.
If you really need it work, you better pass the value to a hidden text box in the parent form and then copy the value in the subform.

Good luck

Estuardo
 
My subform is not a continuous form, and I had absolutely no problem using the calendar control to insert a date into this form as a stand-alone form separate from its parent. I only recoded the command to insert the date because I was referencing a subform within a form. My problem is that it won't even recognize the existence of the parent form,(frmPatients), let alone the subform. I am getting a object-reference run time error, and I don't think it's related to the use of this ActiveX calendar control at all. Thanks.
-- Michel
 
Michel:
Check if the subform is properly linked with its parent, a way to test it is typing Me. and the name of subform, if the intellisense finde the form, the it is properly linked, if not, you will have to remove the subform and insert it again using the wizard Why? i'm not sure, but is the only way i can make it works.
If not is it, well we will have to find somewhere else.

Good luck

Estuardo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top