Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error 2427 when retrieving value from subform

Status
Not open for further replies.

jamaarneen

Programmer
Dec 27, 2007
213
BE

Hi everybody

Here is my situation:

I have a mainform, subrform 1 (requests, and subform 2 (orders). each of these subforms have got - among others - a textbox (total) with some functions as control source.
the subforms are working.

I would like to get the value from these totaltexboxes, in a textbox on the mainform. this should be triggered in a click_event from a control on the mainform.

my code in the event will be:
Code:
    Me![i]textboxName[/i] = [i]SubformName[/i].Form!txtTotal.Value

but how weird, for subform 1 it's working perfect, but for subform 2, if the value of subform2!textboxTotal is zero, then i'm getting error 2427: "you entered an expression that was no value".
and yes, i tried working with Nz() - the same error!

it's weird because for subform 1 it's working perfect even with a zero value.

thanks in advanced for your help
Ja
 
What happens, might be wrong, but the syntax I use would be

Me.Textboxname = Forms!NameofMainform!Nameofsubform.Form.txtTotal.value

Above line of code is single line, its cramped up in the window of this reply
 
What about this ?
Me!textboxName = Val(SubformName.Form!txtTotal.Value & "")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 


Thanks PHV (i just returned to my desk)
but,
still the same error.

again, when the value in subform 2 is greater then zero, then it works. only the zero value returns an error.
and also, the same code will work for subform 1, although it is a zero.

 

Hi again everybody,
No solution? :-(
so I'll have to try to figure out some workaround...(I hate workarounds)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top