473,503 Members | 11,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table Names And Field Names

Hi All,

I am trying to create an Import Form to "Map Fields" for importing many
different tables into 1.

The form I created has 2 columns of comboboxes ( A - AA) thru (J - JJ).

The rowsource for comboboxes with the double letters "AA" is the table
I am importing into and the Row Source Type is Field List.

I need to :

1) Select a table to import FROM
2) Make the selected table Fieldlist available in the single letter "A"
comboboxes
3) Be able to save this "Map"

ANY help is appreciated
EiEiO

Jan 25 '06 #1
5 2592
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use a query to get the names of the tables instead of a value list:

SELECT name
FROM msysobjects
WHERE flags = 0 AND type = 1

To get the column names of the selected table you can use the DAO
TableDef's Fields collection. E.g.:

Dim db As DAO.Database
Dim fld As DAO.field
Dim strTable As String

Set db = CurrentDb

strTable = Me!cboTables

For Each fld In db.TableDefs(strTable).Fields
Debug.Print fld.Name
' If you want to load the field names into a combo box:
' Me!cboFields.AddItem fld.Name
Next fld

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9fuzIechKqOuFEgEQJyDACfRVhBEacptIx9+kxHxOnvUt NIWxgAoIb+
88I2gZS1F3TG95OL6g47pYyZ
=iGNf
-----END PGP SIGNATURE-----
EiEiO wrote:
Hi All,

I am trying to create an Import Form to "Map Fields" for importing many
different tables into 1.

The form I created has 2 columns of comboboxes ( A - AA) thru (J - JJ).

The rowsource for comboboxes with the double letters "AA" is the table
I am importing into and the Row Source Type is Field List.

I need to :

1) Select a table to import FROM
2) Make the selected table Fieldlist available in the single letter "A"
comboboxes
3) Be able to save this "Map"

ANY help is appreciated
EiEiO

Jan 25 '06 #2
MG,

Thank you for your reply.
At the risk of sounding like a dope, <<To get the column names of the
selected table you can use the DAO
TableDef's Fields collection. E.g.: >> where will I insert this code?
Thank you
EiEiO

Jan 25 '06 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In the VBA module of the form that is holding the ComboBoxes; in the
AfterUpdate event of the tables ComboBox.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9f8y4echKqOuFEgEQL44wCgps7JLtpUb49GmiYsO+gs9E P4wfwAniff
as72UBlO2n8hVKt3bZEbUoob
=UNy1
-----END PGP SIGNATURE-----

EiEiO wrote:
MG,

Thank you for your reply.
At the risk of sounding like a dope, <<To get the column names of the
selected table you can use the DAO
TableDef's Fields collection. E.g.: >> where will I insert this code?
Thank you
EiEiO

Jan 25 '06 #4
MG,
Great... that was it thank you!
Do you have any idea why selecting different tables without closing the
form "appends" values to the "A" comboboxes and a workaround for it? In
other words, refresh the comboboxes when a different table is selected?

I really do appreciate your help!

EiEiO

Jan 26 '06 #5


I "think" I'm on the right track here?
But, Access complains with Run-time error '3078' ... cannot find input
table 'iTable'

iTable = the table I am importing FROM
tImportTemp = the table I am importing TO
List210 = the listbox on my form that displays the available tables
x = the combobox on my form that contains the fieldnames from List210
xx = the combobox on my form that contains the fieldnames from
tImportTemp

Dim iTable As String
Dim tImpTemp As String
Dim x As String
Dim xx As String
tImpTemp = timporttemp
iTable = Twebbanner
x = Me.a
xx = Me.aa
DoCmd.RunSQL "insert into tImportTemp.xx SELECT iTable.x FROM iTable"
EiEiO

Jan 26 '06 #6

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

Similar topics

36
4613
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am...
6
1996
by: Dirk Van de moortel | last post by:
Hi, We have a database with some tables with (what I would denote as) 'referred field names'. Like this: DataTable1 with fields F1, F2, F3 DataTable2 with fields F3, F4, F5 DataTable3 with...
3
18502
by: Tom | last post by:
Data is collected over time in an Excel worksheet with 20 columns. The Excel worksheet starts out as a copy of a template as is filled in as data is collected. Eventually the worksheet file is...
1
2614
by: Randy | last post by:
Access= 2002 I'm NOT a Programmer, but I have used VB in the past to do some things ( Spaghetti Code King) so I have some understanding of Coding I need to replace a text field (teacher) in...
3
2448
by: bitoulis | last post by:
Hi, is it possible to use the records of a table as the field names of another table? If yes, how is it done? Thanks in advance Laertes
6
4815
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
6
1600
by: Senna_Rettop | last post by:
Hello, I'm new at Access and ran into a problem. I have a table with a field for customer's names. I want to make a lookup field out of the names by linking it to a table that holds all the...
11
10273
by: Tim Hunter | last post by:
Hi I am using WinXP and Access 2003 Is it possible to store the field names of a table in an array and then loop through the array and update the table using the field names stored in the array? I...
4
22458
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
2
3883
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg...
0
7098
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...
0
7364
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...
1
7017
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...
0
4696
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...
0
3186
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...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
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 ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.