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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|