NatH
Posts: 9
|
| Posted: 03/22/2006, 10:53 AM |
|
In a record form, I have a listbox from another table. I want two fields to be displayed in the listbox. Noted below is the SQL used.
I simply want to save the record number of the selected row in the record form table.
===========SQL =================
SELECT HhFName + '-' + HhLName AS Expr1
FROM HH
ORDER BY HhLName
When tested, I get the following error.
======= Error Message ===========
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/churchroll/Classes.asp, line 2479
Noted below you will find the info from the propeties of the listbox.
============== Listbox Properties ================
Control Source Type = Database Column
Data Source Type = Table / View
Bound Column = HhId (key)
Text Column = Expr1
Data Type = Text
Any help would be greatly appreciated.
NatH
|
 |
 |
WKempees
|
| Posted: 03/23/2006, 3:31 AM |
|
Listboxes always contain (ID, Value)
You have succesfully build expr1 as a concatenation of two text fields and a
dash, now you need to supply the id as well.
SELECT Id, HhFName + '-' + HhLName AS Expr1
FROM HH
ORDER BY HhLName
Find the uniquely identifying column, the one you want to store in the
target record.
"NatH" <NatH@forum.codecharge> schreef in bericht
news:644219d461ba0b@news.codecharge.com...
> In a record form, I have a listbox from another table. I want two fields
> to be
> displayed in the listbox. Noted below is the SQL used.
>
> I simply want to save the record number of the selected row in the record
> form
> table.
> ===========SQL =================
>
> SELECT HhFName + '-' + HhLName AS Expr1
> FROM HH
> ORDER BY HhLName
>
> When tested, I get the following error.
>
> ======= Error Message ===========
> Error Type:
> ADODB.Recordset (0x800A0CC1)
> Item cannot be found in the collection corresponding to the requested name
> or
> ordinal.
> /churchroll/Classes.asp, line 2479
>
> Noted below you will find the info from the propeties of the listbox.
>
> ============== Listbox Properties ================
>
> Control Source Type = Database Column
> Data Source Type = Table / View
> Bound Column = HhId (key)
> Text Column = Expr1
> Data Type = Text
>
> Any help would be greatly appreciated.
>
> NatH
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|