We help IT Professionals succeed at work.

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

SCS1ST
SCS1ST asked
on
Medium Priority
1,174 Views
Last Modified: 2010-10-05
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
Comment
Watch Question

Commented:
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 :-)

Author

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.

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

as the link of Dave will tell you.

Nic;o)

Author

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.  
CERTIFIED EXPERT

Commented:
Guessing....
How about  Me.DailyRptHeadF.form!DailyID.value
Scott C.
Commented:
*maybe* is needs a refresh or soemthing..

Dim a As Variant

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

Dave

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
That doesn't work either.  It doesn't even give me the value of the DailyID.  Where at least I got that before.

Author

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.  
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.