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
    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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Forms: Refer to Form and Subform properties and controls:

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

Dave :-)
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.
 a = Me.DailyRptHeadF.form!DailyID    

as the link of Dave will tell you.

Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

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.  
How about  Me.DailyRptHeadF.form!DailyID.value
Scott C.
*maybe* is needs a refresh or soemthing..

Dim a As Variant

'// rest of your code


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
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.  
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.