SetFocus -- Selecting a Control on a Nested Subform

L

lmcc007

I was trying to create a form that looks sort like the Outlook Contract
Manager's form. Phone types needs to be attached to a phone number.

My form now looks like:

Business 800-123-4567
Business 2
Business Fax 888-123-4567
Mobile 811-123-6789

dhookom figured out how to get what I wanted using text boxes instead of
combo boxes. The following is what he suggested:You are missing the
CompanyID in tblPhoneNumbers. I would create a unique index on CompanyID and
PhoneType in tblPhoneNumbers.

As I stated, you can create a small subform based on tblPhoneNumbers with
only the Phone field bound to a text box.

Add this subform four times to frmCompanies. Add four text boxes to this form:

Name: txtBusiness
Control Source: ="Business" (value from tblPhoneTypes)
Enabled: No
Locked: Yes

Name: txtBusiness2
Control Source: ="Business 2" (value from tblPhoneTypes)
Enabled: No
Locked: Yes

Name: txtBusinessFax
Control Source: ="Business Fax" (value from tblPhoneTypes)
Enabled: No
Locked: Yes

Name: txtMobile
Control Source: ="Mobile" (value from tblPhoneTypes)
Enabled: No
Locked: Yes


Then set the link master/child for the four subforms to

Link Child: CustomerID;PhoneType
Link Master: CustomerID;txtBusiness (or txtBusiness2 or txtBusinessFax
or txtMobile)


This will always display the appropriate values for each of the four
"hard-coded" phone types. You could add another subform for misc other phone
types that aren't part of the original four.
 

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

Similar Threads


Top