Re: Question on FIELDS

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: DIOS (sindizzy_at_softhome.net)
Date: 10/08/04

  • Next message: Michael Peters: "'blank' Access double fileds return strange results"
    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?


  • Next message: Michael Peters: "'blank' Access double fileds return strange results"

    Relevant Pages

    • Re: Need Help..
      ... this part of the script is working. ... The part where we must add disconnected computers to the database i can't ... Dim strComputerName ' The Computer Name to be queried via WMI ... Dim iCursorType ' The Cursor Type for the Recordset ...
      (microsoft.public.windows.server.scripting)
    • Re: How to import certain fields from access database?
      ... I added the code but its not displaying any values in the textboxes. ... The first imports data from a database ... Dim myActiveRecord As Recordset ...
      (microsoft.public.word.mailmerge.fields)
    • Re: How to import certain fields from access database?
      ... Doug Robbins - Word MVP ... The first imports data from a database ... Dim myActiveRecord As Recordset ...
      (microsoft.public.word.mailmerge.fields)
    • Re: How to import certain fields from access database?
      ... Most probably the Combobox Exit event would be the best, ... Dim myActiveRecord As Recordset ...
      (microsoft.public.word.mailmerge.fields)
    • Re: Is This Possible ... ? Yes - Upload images to an Access database
      ... It looks like your databases folder is outside the root of your web ... I created a database exactly as you said, the only change I made was to ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
      (microsoft.public.dotnet.framework.aspnet)