Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 19th, 2005, 07:13 AM
Authorized User
Join Date: Dec 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default need help

hi all members i need help in
Microsoft Access, I create a table EmpMstr,
PayMstr, FamMstr in my EmpMstr Table there are Empnumber,
Empname, Empdepartment, Empnumbers is primary key, in PayMstr
Empnumber,Basic, Allowances, in FamMstr Empnumber,Famname, Relation,
Age . I design a EmpMstr Form I make Combo box in date control source
that wrote the queries select distinctrow empmstr.* from empmstr
order by [empmstr].[empnumber]. Now my problems is when I select
Empnumber from Combo Box I want show all details from PayMstr, FamMstr
in Sub Form. Please explain me how should I to do

Mohamed Mohiddin
Mohamed Mohiddin
Old March 19th, 2005, 12:18 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post

Mohamed, you should probably open the sample Northwind database to study how subforms work. Perhaps this will help with your analysis...

Lets suppose you give your combo box the name "cboEmpNumbers". The settings for the combo box should be:
Row Source Type: Table/Query
Row Source: The query you specified (or something better, see below)
Bound column: 1
Limit to List: Yes
Column count: 1 (but I have another idea with something better)

Create a subform with a query that includes EmpNumber and whatever fields you want from your PayMstr and FamMstr tables. The subform on the main form will have these properties:
Link Child Field: EmpNumber
Link Master Field: cboEmpNumbers (your combo box field)

I would recommend that that your query for the combo box Row Source be:
Select EmpNumber, EmpName from EmpMstr Order by EmpName

Then change the properties for the combo box as follows:
Column Count: 2
Column widths: 0";2"
List Width: 2.25"

This will display the name of the employee instead of the employee's number.

Hopefully that will get you started.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.