Re: Question on FIELDS
From: DIOS (sindizzy_at_softhome.net)
Date: 10/08/04
- Previous message: Michael A. Gunther: "Re: Adjusting Field Size"
- Messages sorted by: [ date ] [ thread ]
Date: 8 Oct 2004 14:42:01 -0700
Well first of all you didnt spell the variable the same..."FieldName"
vs "FieldsName".
Second, why dont you try:
Dim db1 As Database
Dim rs1 As Recordset
Dim FieldName as String
Set db1 = OpenDatabase(App.Path & "\Sample.mdb")
Set rs1 = db1.OpenRecordset("Select * From Table1")
rs1.Movelast
FieldName = "ID"
Msgbox rs1(FieldName)
'or Msgbox rs1.Fields(FieldName)
AGP
@ wrote in message news:<h9p1l0h3fbrgubi535pg8s3gr45thirm1k@4ax.com>...
> I want to indirectly access a field called "ID" I know this syntax is
> wrong but I do not know how to corrected it
>
> Dim db1 As Database
> Dim rs1 As Recordset
> Dim FieldName as String
>
> Set db1 = OpenDatabase(App.Path & "\Sample.mdb")
> Set rs1 = db1.OpenRecordset("Select * From Table1")
>
> FieldName = "ID"
> Masgbox Fields!FieldsName
>
>
> I get an item not found in this collection error
>
> What am I doing wrong?
- Previous message: Michael A. Gunther: "Re: Adjusting Field Size"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|