newbie:enter an expression that has no value

cuongvt

Registered User.
Local time
Today, 15:12
Joined
Aug 18, 2004
Messages
11
I have "limit" control on the mainform and "currentremainedsubform" subform that have a source is "currentremainedquantity" query.
On current event: I added below codes:

Private Sub Form_Current()
If Forms!products!currentremainedSubform.Form!Remaine d > Me.limit Then
With Me.ALERT
.Visible = False
End With
Else
With Me.ALERT
.Visible = True
End With
End If
End Sub
So as to find out wich product that have the quantity on hand which already came to limit.
Abobe code works fine except that if there is a product that does not value in the "remained" control, microsoft access returned this message:
"run time error '2427'
You entered an expression that has no value".
could any one improve my code to clear above error message?
I'm newbie to access so I'm felling hard to work with it.
many thanks. :)
 
what is Alert ? Is it a textbox ?

Why don't you use a msgbox instead ?
 
cuongvt,

Use:

Nz(Forms!products!currentremainedSubform.Form!Remained, 0)

or use the Nz in the query.

Wayne
 
It works, but new problem ocurred

thanks. It works.
But new problem occured:
when I went to last record, and then go to new record (newly created and have nothing inside record)
error massage occureds.
Could you see my attached jpg zip file and guide me how can I do to solve?
thanks
 

Attachments

Users who are viewing this thread

Back
Top Bottom