11-21-2001, 05:45 AM
|
#1
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
Run-time error 2448
I have subform(Meetings) nested in a subform(Contacts) nested in a main form(Employees).
I am trying to update the field LastContactDate on the Contacts subform when a meeting has been added on the Meetings subform. The field updates but when I try to switch to next employee I get this error.
I used the following code:
Me.Parent.[LastContactDate] = Me.[MeetingDate]
with the After_Insert event. The runtime error is '2448-You can't assign a value to this object' and possible causes are that the control is on a read only form or the value is too big where neither is the case. Any ideas why I'm getting this?
|
|
|
11-21-2001, 05:56 AM
|
#2
|
Guest
|
Try removing the brackets, and change the name of the fields to something other than the control names
Me.Parent.txtLastContDte = Me.txtMeetDte
|
|
|
11-21-2001, 09:00 AM
|
#3
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
Won't that mean the compiler won't recognise the text box field on the parent form?
|
|
|
11-21-2001, 12:00 PM
|
#4
|
Guest
|
I've just done it using the method I gave you without any errors. I do wonder though why you are storing duplicate data?
|
|
|
11-22-2001, 08:18 AM
|
#5
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks-worked a treat
|
|
|
11-23-2001, 09:21 AM
|
#6
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
Unfortunately, this run-time error has reared its ugly head again-can anyone tell me why this keeps happenning and is there anything else I can try to remedy it?
|
|
|
11-23-2001, 10:53 AM
|
#7
|
Guest
|
You didn't answer why you need to store the date again, it's not neccessary.
|
|
|
11-27-2001, 03:19 AM
|
#8
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
Sorry Rich, let me explain what I'm trying to do. I have a one to many relationship between Contacts and Meetings(A Contact can have many meetings). In the Contacts table I have a field :LastContactDte which stores the date when the Contact last met with one of our employees. I then have a subform in the Contacts form where the user can input details of new meetings, including the field MeetingDte. When a new meeting is added, I want to update the LastContactDte field on the Contacts form with that of the new meeting on the Meetings sub form. I hope that makes a little more sense.
Thanks
Alex
|
|
|
11-27-2001, 04:59 AM
|
#9
|
Guest
|
You are storing duplicate date, the dates are already stored in the meetings table and can be retrieved at any time via a query using the Max function or since you want to display the last date, delete the field from the Contacts table delete the text box, add an unbound text box set control source to =DMax("DteField","Meetings","([ContactID] = " & [Forms]![MainFrmName]![SubformName]![ContactID] & ")").
HTH
|
|
|
11-28-2001, 04:05 AM
|
#10
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
I can't get the expression to work. Seems to be complaining about the dot operator '.HTH' at the end of the expression. Any ideas?
|
|
|
11-28-2001, 05:59 AM
|
#11
|
Guest
|
=DMax("DteField","Meetings","([ContactID] = " & [Forms]![MainFrmName]![SubformName]![ContactID] & ")")<end of statement
HTH Hope This Helps
|
|
|
11-28-2001, 08:24 AM
|
#12
|
Junior Member
Join Date: Nov 2001
Location: UK
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks-Sorry but still having problems. That seems to work on it own but the proble seems to be becuse I have 2 levels of subforms. The main form is Employees, the subform is Contacts and the second subform is Meetings. The control that needs to be updated is in the first Subform(Contacts)and the Meeting Date field is in the second nested subform. When I open up the 1st Subform the control populates as required. However when I open up the main form, I get the #Name? error in the control. Any ideas-thanks for all the help so far.
|
|
|
11-28-2001, 10:45 AM
|
#13
|
Guest
|
Have you tried =DMax("DteField","Meetings","([ContactID] = " & [Forms]![MainFrmName]![SubformName]![2ndSubForm]![ContactID] & ")")
|
|
|
03-14-2010, 04:20 AM
|
#14
|
Newly Registered User
Join Date: Dec 2009
Posts: 69
Thanks: 4
Thanked 0 Times in 0 Posts
|
Re: Run-time error 2448
You control may not be referenced to the Table. i hope you already found the solution. check your forms query. have a good day.
|
|
|
03-14-2010, 04:21 AM
|
#15
|
Newly Registered User
Join Date: Dec 2009
Posts: 69
Thanks: 4
Thanked 0 Times in 0 Posts
|
Re: Run-time error 2448
hehe..wow...thats was logn ago.
|
|
|
Thread Tools |
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
All times are GMT -8. The time now is 05:52 AM.
|
|