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

SQL VBA form question.

Status
Not open for further replies.

allenEd

Technical User
Nov 14, 2002
129
GB
Hi,

SQL VBA form question.

example of the problem.

If I have two tables, table one tblnames with fields FirstName, Lastname, Dept in it.

table two tblProject, with a combo box cboLastName, which is linked to tblnames, so you can see all the fields of tblnames in the drop down.

How do I populate text boxes in a form frmProject (data from tblProject), with the FirstName and Dept, depending on what LastName the combo box says?

thanks
Allen
 
Presumably you only want to display this data, not save it to the projects table? If so, you can refer to the Column property of the combo in the Control Source of the textboxes, for example:

[tt]=cboPerson.Column(1)[/tt]

Column numbering starts from zero.

 
It gets a litte tricky, when I save the form as a report. Then using .column(1) dosn't appear to work...

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top