A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Error 2427 You entered an expression that has no value



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 02:58 PM
M Skabialka
external usenet poster
 
Posts: n/a
Default Error 2427 You entered an expression that has no value

A module in form frmPRONGeneration looks at values on the subform like this:

Dim ps As Form
Set ps = Forms!frmPRONGeneration![frmPRONGeneration subform].Form
Select Case ps!LastSerialNumber 'Error 2427 You entered an
expression that has no value
etc

LastSerialNumber is a field on the subform

Why am I getting the error 2427?
I don't understand in what way it has no value.

Thanks,
Mich


  #2  
Old June 4th, 2004, 03:57 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default Error 2427 You entered an expression that has no value

Couple of example:

What kind of control is LastSerialNumber?
It would have no value if it were a label, for example.

If the subform had no records and no new records could be added, the subform
goes completely blank. Attempting to refer to the value of the non-existent
control then generates an error.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"M Skabialka" wrote in message
...
A module in form frmPRONGeneration looks at values on the subform like

this:

Dim ps As Form
Set ps = Forms!frmPRONGeneration![frmPRONGeneration subform].Form
Select Case ps!LastSerialNumber 'Error 2427 You entered an
expression that has no value
etc

LastSerialNumber is a field on the subform

Why am I getting the error 2427?
I don't understand in what way it has no value.

Thanks,
Mich




  #3  
Old June 4th, 2004, 04:46 PM
M Skabialka
external usenet poster
 
Posts: n/a
Default Error 2427 You entered an expression that has no value

I am having the user select from 3 combos, each one refines the information
for the subform, and the last choice selects the only record for the
sub-form.

The code runs on the update of the last combo. Then I look at some of the
data and make some updates to the info on the sub-form.

If I reselect the last combo while the sub-form is still populated I don't
get the error message.

Should I be using something else other than the After Update to run the
subsequent info update code?

Thanks,
Mich

"Allen Browne" wrote in message
...
Couple of example:

What kind of control is LastSerialNumber?
It would have no value if it were a label, for example.

If the subform had no records and no new records could be added, the

subform
goes completely blank. Attempting to refer to the value of the

non-existent
control then generates an error.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"M Skabialka" wrote in message
...
A module in form frmPRONGeneration looks at values on the subform like

this:

Dim ps As Form
Set ps = Forms!frmPRONGeneration![frmPRONGeneration subform].Form
Select Case ps!LastSerialNumber 'Error 2427 You entered an
expression that has no value
etc

LastSerialNumber is a field on the subform

Why am I getting the error 2427?
I don't understand in what way it has no value.

Thanks,
Mich






  #4  
Old June 4th, 2004, 04:59 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default Error 2427 You entered an expression that has no value

If ps.RecordsetClone.RecordCount = 0 Then
MsgBox "Cannot read value (unless records can be added)"
Else
'do your stuff

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"M Skabialka" wrote in message
...
I am having the user select from 3 combos, each one refines the

information
for the subform, and the last choice selects the only record for the
sub-form.

The code runs on the update of the last combo. Then I look at some of the
data and make some updates to the info on the sub-form.

If I reselect the last combo while the sub-form is still populated I don't
get the error message.

Should I be using something else other than the After Update to run the
subsequent info update code?

Thanks,
Mich

"Allen Browne" wrote in message
...
Couple of example:

What kind of control is LastSerialNumber?
It would have no value if it were a label, for example.

If the subform had no records and no new records could be added, the

subform
goes completely blank. Attempting to refer to the value of the

non-existent
control then generates an error.


"M Skabialka" wrote in message
...
A module in form frmPRONGeneration looks at values on the subform like

this:

Dim ps As Form
Set ps = Forms!frmPRONGeneration![frmPRONGeneration subform].Form
Select Case ps!LastSerialNumber 'Error 2427 You entered an
expression that has no value
etc

LastSerialNumber is a field on the subform

Why am I getting the error 2427?
I don't understand in what way it has no value.

Thanks,
Mich



  #5  
Old June 4th, 2004, 07:05 PM
M Skabialka
external usenet poster
 
Posts: n/a
Default Error 2427 You entered an expression that has no value

Solved it!

I put
ps.Requery
right before
Select Case ps!LastSerialNumber

and now it is working!

There is always a record in the sub-form because the combos are selecting
from values in the same table the sub-form uses.

Thanks for your help!
Mich


"Allen Browne" wrote in message
...
If ps.RecordsetClone.RecordCount = 0 Then
MsgBox "Cannot read value (unless records can be added)"
Else
'do your stuff

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"M Skabialka" wrote in message
...
I am having the user select from 3 combos, each one refines the

information
for the subform, and the last choice selects the only record for the
sub-form.

The code runs on the update of the last combo. Then I look at some of

the
data and make some updates to the info on the sub-form.

If I reselect the last combo while the sub-form is still populated I

don't
get the error message.

Should I be using something else other than the After Update to run the
subsequent info update code?

Thanks,
Mich

"Allen Browne" wrote in message
...
Couple of example:

What kind of control is LastSerialNumber?
It would have no value if it were a label, for example.

If the subform had no records and no new records could be added, the

subform
goes completely blank. Attempting to refer to the value of the

non-existent
control then generates an error.


"M Skabialka" wrote in message
...
A module in form frmPRONGeneration looks at values on the subform

like
this:

Dim ps As Form
Set ps = Forms!frmPRONGeneration![frmPRONGeneration subform].Form
Select Case ps!LastSerialNumber 'Error 2427 You entered an
expression that has no value
etc

LastSerialNumber is a field on the subform

Why am I getting the error 2427?
I don't understand in what way it has no value.

Thanks,
Mich





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.