[AccessD] Procedure on subform erroring out

John Clark John.Clark at niagaracounty.com
Tue May 11 08:23:35 CDT 2010


Thanks for this. As soon as I read it, I thought, "Doh! That is it. I can't believe I missed that." But, it actually did not fix the problem. It did change it...w/I add the parent form:
 
"[Forms]![frmDataEntry]![frmCert_sub]![CredHours]"
 
It give me a similar error...actually I get the same error, but then, if I try to back out of the form, I also get, "...can't find 'frmDataEntry'"
 
In the mean time, I found an easy fix. Like I said, I inherited this program, and w/I asked where these "FTE numbers" came from, they said, "That is just what they are." OK, so they were arbitrary, I figured. I've since discovered that they are simply [CreditHrs]/30...I can't believe I went through all this work, w/it is a simple calculation. They didn't know this themselves though...w/I told them, I had to first prove it, and then they were floored..."We were always told they were [arbitrary]"
 
I wish I had time to figure out this problem though, because I just hate leaving it, but I can repair it in 5 min., using the simple calculation.
 
Thanks anyhow

>>> Steve Schapel <miscellany at mvps.org> 5/6/2010 3:15 PM >>>
John,

I expect this will be related to something you have in the qryGrabFTE query, 
either as a calculated field expression, or in a Criteria.  If there is 
somethig in there like:
[Forms]![frmCert_sub]![SomeControl]
... then this won't work, as frmCert_sub is not open at the time, but rather 
just contained and displayed within the subform on the parent form.
Thus you will need to change it to the equivalent of:
[Forms]![NameOfParentForm]![frmCert_sub]![SomeControl]
... or, as some would have it:
[Forms]![NameOfParentForm]![frmCert_sub].[Form]![SomeControl]

Regards
Steve


--------------------------------------------------
From: "John Clark" <John.Clark at niagaracounty.com>
Sent: Friday, May 07, 2010 6:56 AM
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Subject: [AccessD] Procedure on subform erroring out

> This is probably something easy, but I'm not getting it...
>
> As I said, in a past post, I inherited this program, from another county. 
> Well, I've basically re-written it now. Unless they know something I 
> don't, I don't think theirs is working properly. So, I went a different 
> way w/it. In short, I split things up into a student table, and a 
> certificate table, w/the former being one single record for each student 
> that comes in, and allowing for an indeterminate amt of certificates. So, 
> I split up the main entry form to, and I am using a subform for this.
>
> I made some changes...enhancements...to automate some things, but w/I went 
> to run it from the main form, I got the following error:
>
> "College can't find the form 'frmCert_sub' referred to in a macro 
> expression or Visual Basic code."
>
> I am assuming that this has something to do w/running this code being on 
> the subform...basically, it just takes the "Credit Hours," upon exiting 
> that field, and determines the "FTE" number, but checking against a table 
> of values. It works fine, w/I run the subform alone, but not w/along w/the 
> main form.
>
> The really puzzling thing though, is that other similar code is running 
> fine...I have nav buttons programmed there, I have a buttons that copy 
> data to a column and relocate themselves, and I've got a test field that 
> combines two other fields to make a unique code. This latter one is 
> similar I think, to the one that isn't working.
>
> Here is the code that isn't working...
> _____________________________________________
> Private Sub CredHours_Exit(Cancel As Integer)
>
> If CredHours < 12 Then
>    EnRollOpt = 2
> Else
>    EnRollOpt = 1
> End If
>
> Me.FTE = DLookup("numFTE", "qryGrabFTE")  <------- specifically, this line
>
>
> End Sub
> ________________________________________________
>
>
> And here is code that IS working...
>
> __________________________________________________
>
> Private Sub Text11_Click()
>
> Text11.Value = Year(Certificate_Date) & Semester.Value
>
>
> End Sub
>
> Any ideas? What do I need to do to have it work w/running the parent form? 
> I'm never going to be running it any other way actually.
>


-- 
AccessD mailing list
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list