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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup from one table - info to another 1

Status
Not open for further replies.

HMJ

Technical User
Nov 29, 2002
58
US
We have a need to insure that individual names are always the same in every table. This is the only way we can isure that reports and searchs find ALL the relevant information needed. What we would like to do is pull the name from table#1 and use it to insert information into table#2.

A drop down list can find the name from table#1. But, how can we insert the selected name into table#2 along with the new record that is being created?

Thanks.

Harry Jessen
HMJessen@Yahoo.com
 
The combo for table1 will have its RowSource set to table1 and now needs the Contro Source set to the Name field of table2 - that way when you select from table1 it will write the information to table2 name field
 
I actually have a question on this.

I have a similar situation.

I have a drop down box (that lists 10 columns regarding pending projects requiring a survey). Once that is selected, I want it to

1) Open a new record in the current form AND
2) Populate about 6 of the fields using data from the drop down list AND
3) Write that record to the table

Because I have 10 columns in my first drop down box - it doesn't appear I can set the Control Source to the table where I write the survey information. What do I need to do to autopopulate those fields correctly and subsequently write them to the table?

Any ideas?

Regards,
Lisa
 
That's a lot of columns but no problem:
In the After_Update event of the combo put:
DoCmd.GoToRecord,,acNewRec
Me.txtField1 = Me.comboName.Column(1)
Me.txtField2 = Me.comboName.Column(3)
Me.txtField3 = Me.comboName.Column(5)
Me.txtField4 = Me.comboName.Column(9)
Me.txtField5 = Me.comboName.Column(10)

Have the txtFields with their Control Source set to the field names for the table you wish to populate.
You need to remember that columns in a combo list are numbered from zero so column(2) is the third column in the list

 
TO: Trendsetter

Thank You! It worked!

Now I can't wait to hear why they can't figure out who is who.

Harry Jessen
HMJessen@Yahoo.com
 

TO: Trendsetter

I put mine in, but it didn't take for some reason, so here it is again!


Harry Jessen
HMJessen@Yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top