473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get number of fields in a table?

Folks,
Once you have created a table, by importing, etc, is there anyway to
easily look up how many fields are in it? Counting in the design view
or table view is not very accurate.

Tx
Judith

Jun 9 '06 #1
3 9315
j.******@cox.ne t wrote:
Folks,
Once you have created a table, by importing, etc, is there anyway to
easily look up how many fields are in it? Counting in the design view
or table view is not very accurate.

Tx
Judith


Press Ctl-G to bring up the VBA immediate window and type...

?CurrentDB.Tabl eDefs("TableNam e").Fields.Coun t <Enter>
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 9 '06 #2
Rick, Thanks, you got my question right but I tried it and it didn't
work. Is there a point and click solution? It will be hard for me to
remember this one even if I can get it to work. I'm not too VBA
literate.

Tx
Judith
Rick Brandt wrote:
j.******@cox.ne t wrote:
Folks,
Once you have created a table, by importing, etc, is there anyway to
easily look up how many fields are in it? Counting in the design view
or table view is not very accurate.

Tx
Judith


Press Ctl-G to bring up the VBA immediate window and type...

?CurrentDB.Tabl eDefs("TableNam e").Fields.Coun t <Enter>
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Jun 11 '06 #3
j.******@cox.ne t wrote:
Rick, Thanks, you got my question right but I tried it and it didn't
work. Is there a point and click solution? It will be hard for me to
remember this one even if I can get it to work. I'm not too VBA
literate.


Well it sounded like you wanted a one-time way to get the field count, not
something that you would use over and over. If you want that then you need to
build a custom function that takes a table name as an argument and returns the
field count.

Put the following in a standard module...

Function FieldCount(Tabl eName As String) As Byte
FieldCount = CurrentDb.Table Defs(TableName) .Fields.Count
End Function

....then to get the field count of any table...

=FieldCount("Ta bleName")
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Jun 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3705
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what a spreadsheet might show, the column names will actually be dynamic, based on data from a SQL Server 2000 database. The row data will also come from the same database. So in this case, I will have a main report and a subreport. I've already tried...
1
366
by: Vladislav Moltchanov | last post by:
In Access 2000 help one can find the topic Microsoft Access database table specifications which contains the line: Number of characters in a record (excluding Memo and OLE Object fields) 2,000 What could it mean. I have created a table with 10 text fields each of
0
1481
by: Megan | last post by:
Hi Everybody- I know that this is a really, really long post, but I wanted to try to give you as much background as possible. So here's a quick overview of the issues I'm asking for help with: 1.) I'm trying to create a many to many relationship, and I get the following Error when I try to enforce referential integrity.
7
7235
by: astro | last post by:
Anyone have suggestions on where to troubleshoot this error? Background: -Access 2k v. 9.0.6926 sp3 - front and backend on production server (wiindows 2k) -accessed via Citrix -front-end is mde, backend is mdb -only occurs on the production server -only occurs with mde verson - i've tested the problem with the mdb version of the front-end and it loads/generates the document fine on the production
2
1996
by: ozgirl via AccessMonster.com | last post by:
Hi, hopeing someone can help me here... I have a deductions table and form and want to be able to add many deductions to the table by having only a few fields on the form form fields: deduction ID, start date, end date and amount what i want to be able to do is keep adding a deduction each 7 days from the
2
2241
by: John | last post by:
I have two tables in a 1:M relationship- the parent has 5 fields in the primary key and the child 6 (these are actually pretty far downstream in a complicated ER model, but the problem is between these two). I set up the relationship with no problem- referential integrity and left outer join. I have created two forms- one for the parent and one for the child table. I want to import the child table's form as a subform on the parent...
8
3998
by: King | last post by:
Hi I have following MS Acess query Here is the query ID Name Prgm ID Client ID Date Start Time End Time Minutes C4 Trisha TIP DEK0703 7 /7 /2006 10:00:00 AM 12:00:00 PM 120
3
2821
by: nfrjob | last post by:
Hi there, I'm an advanced beginner, so please bear with me... I have a simple table that has four fields in it: Zone (which will store a three letter code such as ABC), Year (a four digit number field), Number (which is the problem field) and Label (which will be the concatenation of the previous three fields). There will be a variety of three letter codes stored in the Zone field (11 to be precise) and the Year field will have a very...
1
1559
by: Karl | last post by:
In an mde with only custom menus I use transferspreadsheet to transfer data from an Excel worksheet to a new Access 2000 table and the users need to preview the data in the table. The names of the fields and the the number of fields created in the table can be different each time I have a query based on table with the * in the first column and it displays all the fields names and data OK
8
1841
by: Elfae | last post by:
I have searched high and low for a sample for this, and I just can't find any. Sorry for the length! Background Information The issue revolves around setting up a system-generated increase in two of a three-part field - one numeric the other text. The Org Number, Incremental Number, and Subcontractor Designation make up the Audit Identification number(7) for queries and reports. There is a hyphen between Org Number and Incremental...
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.