RTE-2427 'You entered an expression that has no value'

I'm all of a sudden getting this error "YOU ENTERED AN EXPRESSION THAT HAS NO VALUE" on the below asterisked line.  Strange thing is that when I Debug, the DailyID has a value, a is empty.  If I F8 through the code it works.  What is stopping it?  

Private Sub TemJobNumb_BeforeUpdate(Cancel As Integer)

If IsNull(Me.TemJobNumb) Then
    Me.DailyRptHeadF.Enabled = False
Else
    Me.DailyRptHeadF.Enabled = True
End If
Dim a As Variant

If Not IsNull(Me.DailyRptHeadF!DailyID) Then
  *  a = Me.DailyRptHeadF!DailyID    *Error occurs here.  
    Me.DailyRptHeadF.Form.[DailyRptTimeCardF].Form.RecordSource = "select * from TimeCardDailyRQ() TimeCardDailyRQ where (DailyID = " & a & ")"
End If
End Sub
SCS1STAsked:
Who is Participating?
 
flavoCommented:
*maybe* is needs a refresh or soemthing..

Dim a As Variant

Me.DailyRptHeadF.Form.Requery
Doevents
'// rest of your code

Dave
0
 
flavoCommented:
Hi SCS1ST,
Forms: Refer to Form and Subform properties and controls:
http://www.mvps.org/access/forms/frm0031.htm

Is DailyRptHeadF the name of the form object or the subform CONTROL name, it needs to be the later

Dave :-)
0
 
SCS1STAuthor Commented:
DailyRptHeadF is the subform on a form called DailyF.  The dailyid is on the subform.  The tempjobnum field on the dailyF form calls this code.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
nico5038Commented:
Try:
 a = Me.DailyRptHeadF.form!DailyID    

as the link of Dave will tell you.

Nic;o)
0
 
SCS1STAuthor Commented:
That didn't work.  Same error, same response.  I can see that DailyF!DailyID has a value, but a doesn't pick it up until I F8.  
0
 
clarkscottCommented:
Guessing....
How about  Me.DailyRptHeadF.form!DailyID.value
Scott C.
0
 
SCS1STAuthor Commented:
That doesn't work either.  It doesn't even give me the value of the DailyID.  Where at least I got that before.
0
 
SCS1STAuthor Commented:
Dave, that did it.  However it takes a while to come up after the requery.  I was wondering if maybe the second part of the above code shouldn't be moved to AFTER UPDATE.  I'm going to give it a try.  Thanks so much for your help.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.