B benti New member Local time Today, 13:54 Joined Aug 11, 2004 Messages 8 Jun 29, 2005 #1 I'm creating a Graph based on a tmp table with a unknown number of Fields, and seaching for a function to find the total number of Fields directly in the Table or by using a Recordset.
I'm creating a Graph based on a tmp table with a unknown number of Fields, and seaching for a function to find the total number of Fields directly in the Table or by using a Recordset.
W WayneRyan AWF VIP Local time Today, 12:54 Joined Nov 19, 2002 Messages 7,122 Jun 30, 2005 #2 Benti, At the least, you can use a function like DCount to count them: HowMany = DCount("[SomeField]", "SomeTable", "[SomeCriteria] = " & Me.SomeCriteria) Wayne
Benti, At the least, you can use a function like DCount to count them: HowMany = DCount("[SomeField]", "SomeTable", "[SomeCriteria] = " & Me.SomeCriteria) Wayne
tkpstock Cubicle Warrior Local time Today, 07:54 Joined Feb 25, 2005 Messages 206 Jun 30, 2005 #3 Or you can use Code: myRecordset.Fields.Count
M modest Registered User. Local time Today, 07:54 Joined Jan 4, 2005 Messages 1,220 Jun 30, 2005 #4 WayneRyan said: Benti, At the least, you can use a function like DCount to count them: HowMany = DCount("[SomeField]", "SomeTable", "[SomeCriteria] = " & Me.SomeCriteria) Wayne Click to expand... I think this returns the number of records in a given field where the search condition (criteria) exists/is true. I'd use Chris's way or you can manually do the same thing as chris Code: Dim lngCount As Long lngCount = 0 For Each fld in rs.Fields lngCount = lngCount + 1 Next rs is your recordset variable and fld is a recordset field variable
WayneRyan said: Benti, At the least, you can use a function like DCount to count them: HowMany = DCount("[SomeField]", "SomeTable", "[SomeCriteria] = " & Me.SomeCriteria) Wayne Click to expand... I think this returns the number of records in a given field where the search condition (criteria) exists/is true. I'd use Chris's way or you can manually do the same thing as chris Code: Dim lngCount As Long lngCount = 0 For Each fld in rs.Fields lngCount = lngCount + 1 Next rs is your recordset variable and fld is a recordset field variable
B benti New member Local time Today, 13:54 Joined Aug 11, 2004 Messages 8 Jun 30, 2005 #5 This was what I looked for. Thanks a lot to you all!
W WayneRyan AWF VIP Local time Today, 12:54 Joined Nov 19, 2002 Messages 7,122 Jun 30, 2005 #6 Modest, Thanks, I totally misread that. Oops! Wayne