Help with Child Master on Subform within Subform

N

Noemi

Hi

I have Form1 which contains a TabConrtol with 2 pages

Page 2 contains subform called Form2 and this has 5 pages

Each of the pages on Form2 has a subform which shows tables

What I would like to do is when a name from a combobox on form1 is selected
I would like the tables in the pages (subforms on Form2) to show the data but
only which relates to the name selected and no other persons details.

I was trying the linkchild & master but it doesn't seem to work.

I have added a text box to Form2 which is called StaffID and this is what I
would like to use as the link for each table (subform) on the 5 tabs due to
they all have staffid's

Thanks
Noemi
 
A

Alex Dybenko

Hi,
what is not working exactly? shows no records or all records?
StaffID should have a value of selected person ID in combox, and it should
be set as link master field as [StaffID]. Also make sure you that you do not
have other fields named StaffID on the same form, else rename it to
txtStaffID

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
G

Gina Whipp

Noemi,

When connect LinkChild and LinkMaster you might have tried to use the elipse
button and found you couldn't because perhaps your combobox is unbound?
Just type in the name of you combo box for the LinkMaster and the name
StaffID (if that is the name) for the LinkChild. The elipse button won't
let you select the name of fields with no data source.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
N

Noemi

Hi Gina

My combobox has a name but is unbound so will that cause a problem.

So how do I add the combox name itnot hte child and master so they know it
depends on what is seelcted?

Thanks
Noemi
 
G

Gina Whipp

Noemi,

You can base your combo box on a query qryStaff which will include two
fields StaffID and StaffName: [sFirstName] & " " & [sLastName]

Then in the combo box property window.

ColumnCount = 2
ColumnHeads = No
ColumnWidths = 0";1.5"
BoundColumn = 1
LimitToList = Yes

Now when the form opens it will be blank until the User selects a name. If
you do't want them to do anything UNTIL they selct a name then put this on
the On_Change event of your tab control:

If IsNull(Me.NameOfYourComboBox) Then
MsgBox "Please select an Staff memeber first!", vbCritical, "Staff"
Me.NameOfYourTabControl.Pages(5).PageIndex = 4 '********Select the
page you want them to land on.
DoCmd.CancelEvent
End If

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top