"You entered an expression that has no value" Workarounds? (1 Viewer)

cable

Access For My Sins
Local time
Today, 03:00
Joined
Mar 11, 2002
Messages
228
I'm attempting a conversion of a Access 97 app to Access 2010.
I'm hitting a problem with some of the forms where the Form_Load event is complex and sometimes references controls on the form.

2010 is now complaining that "You entered an expression that has no value", whereas 97 didn't.

Firstly is there an check I can add in before the offending lines?
I've tried the ones I can think of (isnull, isempty, isobject).

If there isn't, is the only solution to rearrange the code to a later event? and if so is there a site describing the new sequence of events, and what each was designed for?
 

MSAccessRookie

AWF VIP
Local time
Yesterday, 22:00
Joined
May 2, 2008
Messages
3,428
I'm attempting a conversion of a Access 97 app to Access 2010.
I'm hitting a problem with some of the forms where the Form_Load event is complex and sometimes references controls on the form.

2010 is now complaining that "You entered an expression that has no value", whereas 97 didn't.

Firstly is there an check I can add in before the offending lines?
I've tried the ones I can think of (isnull, isempty, isobject).

If there isn't, is the only solution to rearrange the code to a later event? and if so is there a site describing the new sequence of events, and what each was designed for?

I believe that the description of your problem is too broad to provide the help that you are looking for, since there are a number of possible causes for the condition that you are experiencing. If you could publish the code that fails, and indicate the point where it fails, perhaps we could have a better idea as to what we can do to assist you.
 

cable

Access For My Sins
Local time
Today, 03:00
Joined
Mar 11, 2002
Messages
228
mmm, I can do, but without the pages of initialisation code and the form design its not going to make a lot of sense! Which is why I was looking for the more general case.
Code:
Select Case Cmb_AuditType
Is the line that fails. The combo box is filled with a fixed query, so it has data, though at this point nothing is likely to be selected. The line is in a sub that is called from Form_Load.


Basically this is a typical, some one estimated for a simple conversion, managers agreed, and when it comes to actually doing it, your estimate is blown.

If I can't code a check for the error (without some nasty on error type of approach), then it means I need to redesign the form init logic (on this and possibly lots of the other 40-50 odd forms). So I'll stop and let someone decide how they want to me to proceed (i.e. we could just deploy office 2010 and access 97! :(:banghead:)
 

MSAccessRookie

AWF VIP
Local time
Yesterday, 22:00
Joined
May 2, 2008
Messages
3,428
Try debugging the code as follows:

Set a Breakpoint on the line Select Case Cmb_AuditType.

In the Immediate Window type:

? Cmb_AuditType

and then type

? Cmb_AuditType.Value

See if there is a difference.
 

cable

Access For My Sins
Local time
Today, 03:00
Joined
Mar 11, 2002
Messages
228
Both return the error "You entered an expression that has no value", error 2427.
 

pr2-eugin

Super Moderator
Local time
Today, 03:00
Joined
Nov 30, 2011
Messages
8,494
Try using a Nz(), and creat a Case for that.. Something like..
Code:
Select Case Nz([B]Cmb_AuditType, [/B]"nullValue")
    'your normal cases.
    Case "nullValue"
        Exit Sub
    End Select
 

cable

Access For My Sins
Local time
Today, 03:00
Joined
Mar 11, 2002
Messages
228
It's not null though! But I did try that earlier.

It still complains cmb_audittype has no value, and I guess null is a kind of value.
 

pr2-eugin

Super Moderator
Local time
Today, 03:00
Joined
Nov 30, 2011
Messages
8,494
Okay where is the Select Case placed? i.e. What event? Check if the RecordSource for the combo box is properly placed.. If it is a Table/Query-Check the query, if it is Value list then check the values. Check the Bound columns and number of columns..
 

Users who are viewing this thread

Top Bottom