add field to form

ACCESS NEWB

Registered User.
Local time
Today, 09:52
Joined
Feb 12, 2008
Messages
64
I have finished form created from 1 table and now I would like to add another field from another table to that form.How?
I tried with adding textbox and then setting source to table and field i wish it represents ( tables are linked)
 
You need to create a query which has both tables in it, linked by the key. Make sure all the fields you want for your form are in that query, then set the forms data source to that query. That's the easiest way.
 
maybe you can help me with something else
Both tables have ItemID field.
In my old form under properties of ItemID I set
SELECT [ItemID], [Description] & ", " & [Make] & ", " & [Model] & ",SN# " & [Serial] FROM Items ORDER BY [Description] & ", " & [Make] & ", " & [Model] & ", " & [Serial];
and it shows me all that.
Now I am trying to do the same on my new form but all I am getting is actual Item ID, in other words just number.
Why the same thing does not work now on other form created from same table?
I did not change anything else
 
I'm not sure what you're trying to do.

Are you setting that SQL statement as the data source for a single text field?
 
However, this:

[Description] & ", " & [Make] & ", " & [Model] & ",SN# " & [Serial]

Should be:

([Description] & ", " & [Make] & ", " & [Model] & ", SN# " & [Serial]) AS Info

This is making a new field "Info" which contains all of those other fields, formatted as you want.

So your SQL should look like this:

SELECT Items.ItemID, Items.Description, Items.Make, Items.Model, Items.Serial, ([Description] & ", " & [Make] & ", " & [Model] & ", SN# " & [Serial]) AS Info FROM Items ORDER BY ([Description] & ", " & [Make] & ", " & [Model] & ", SN# " & [Serial]);

It's just best to name it.
 

Users who are viewing this thread

Back
Top Bottom