Re: textbox controsource as recordset field
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Wed, 11 May 2005 14:51:28 -0500
RedFish wrote:
>Here is a paste of the exact chunk of code, only
>with field and table names changed to protect the innocent (per company
>operating procedure). I've only changed the names, not the number of
>fields, tables, or any calculations or anything:
>
>lcSelect = "SELECT myField FROM myTable1 WHERE myField NOT IN ( SELECT [" &
>lcImport & "] FROM myTable2 )"
>Set rstHC = dbs.OpenRecordset(lcSelect)
>If rstHC.RecordCount > 0 Then
> Me.txtHC.ControlSource = rstHC.Fields("myField")
>Else
> Me.txtHC.Visible = False
>End If
>
>The field being returned in this query is a text field. I've made no
>changes to the textbox, just dropped it on the report. I assume it is set
>up to handle text by default. There is no data displayed on the report,
>only "#Name?". Does that help? I basically just started this job, don't
>want to break their rules yet, but I guess I will if I have to. I actually
>used a msgbox in the test I ran that displayed the number of records
>returned (17), so I know there is data. My guess here is that it is the
>controlsource assignment. Unfortunately, my lack of experience with this
>technology means that it is truly a guess.
#Name means that the text box's ControlSource is not the
name of a field in the form's RecordSource table/query.
This implies that either myfield in mytable is not an
acceptable field name OR that you only wanted to assign the
value of the field to the text box (instead of binding the
text box), If the latter is what you really want, then
don't use the ControlSource property:
Me.txtHC = rstHC.Fields("myField")
If I'm still missing the boat, please explain what you're
trying to accomplish and provide a few example values along
with the desired results.
--
Marsh
MVP [MS Access]
.
- References:
- textbox controsource as recordset field
- From: RedFish
- Re: textbox controsource as recordset field
- From: Marshall Barton
- Re: textbox controsource as recordset field
- From: RedFish
- Re: textbox controsource as recordset field
- From: Marshall Barton
- Re: textbox controsource as recordset field
- From: RedFish
- textbox controsource as recordset field
- Prev by Date: Re: How to use like in a report filter
- Next by Date: Re: Can Grow but Not Wrap to next column
- Previous by thread: Re: textbox controsource as recordset field
- Next by thread: How to use "=username()"
- Index(es):
Relevant Pages
|