Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can you add new fields to the recordsource of a form?? 1

Status
Not open for further replies.

jgoodman00

Programmer
Jan 23, 2001
1,510
If so how, because there is much debate over this here....
 
Could you give a bit more detail? The recordsource of a form can just be an SQL statement, and you can modify that in the Open event of the form.

Kathryn


 
By recordsource i mean the fieldlist which you can reference into any given control under control source. I only ask this, because we regularly add fields to our source tables, & these don't show in the field list, so adding these fields can become a real palavar... James Goodman
j.goodman00@btinternet.com
 
I have just done it actually. For some reason I have managed to go all this time without realising you can add fields to the fieldlisting by changing the sql statement (to which i presume you were referring) under recordsource in the form properties......D'Oh!!!! James Goodman
j.goodman00@btinternet.com
 
OK, what is the recordsource of your form? the field list is based on that. That's why I said that you will need to modify your form's recordsource.

You can create a query which contains all the fields in all the tables, no matter if you add fields, by using the asterisk from the top of the field list in query design.

If you have three tables that are the basis of your form, create a query, add all three tables and drag the links between them, if you haven't already set up relationships.

then for each field, doubleclick on the asterisk which is listed at the top of the field list of each table. That tells the query to get all the fields. Make this query the recordsource of your form.

If you add fields, they will automatically be added to the query, and therefore will be part of your recordsource, and therefore will be available in the field list.

I hope that I understood your question.

Kathryn


 
Yes you did, & directed my attention to a field i have never actually noticed before.As I said before.....D'Oh!! James Goodman
j.goodman00@btinternet.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top