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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refer to a field that has no value 1

Status
Not open for further replies.

NewTexican

Technical User
Dec 10, 2004
95
US
I'm using the info from a field on one subform in other subforms. When I scroll to a record on the mainform that doesn't have a record on the subform. I get a "you have entered an expression that has no value" error. NZ and Trim$ don't get rid of this error. Any suggestions?

I'll get the error either in the highlighted code.

Dim compnum As Variant
Dim addtype As Variant
Dim compname As Variant

compnum = Me.Text18
[highlight]addtype = Me.Text20[/highlight]



dim ssthing as string

[highlight]ssthing = Me![Company Address T subform].Form![company address type][/highlight]
 
Try...

If Not IsNull(Me.Text20) Then addtype = Me.Text20



Sam_F
"90% of the problem is asking the right question.
 
Instead of just referencing the field (Me.Text20), try referencing the field and the text property (Me.Text20.Text).

Regards,
Mike

"Don’t get suckered in by the comments – they can be terribly misleading. Debug
only code. – Dave Storer."
 
You may try this:
If Me![Company Address T subform].Form.Recordset.RecordCount > 0 Then
ssthing = Me![Company Address T subform].Form![company address type]
Else
ssthing = ""
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the advice. Neither one is working. me.text20 is "empty" does that change something?

If Not IsNull(Me.Text20) Then [highlight]addtype = Me.Text20[/highlight]

if I try and refer to the text property I get an error message that the field needs focus. If I try and give it focus I can't because the box is not visible.
 
[tt]If trim$(Me.Text20 & "")<>"" Then addtype = Me.Text20[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top