1. In the subform, set the default value on the PersonId field to the parent form's PersonID
2./3. dunno right off. I'll have to look when I get home.
1. In the subform, set the default value on the PersonId field to the parent form's PersonID
2./3. dunno right off. I'll have to look when I get home.
Textbox ControlSource cannot directly reference a field that is not included in the form's RecordSource and not in a combo or list box column.
Suggestion:
Change the PhoneNumberType textbox to a combobox. Property settings:
RowSource: PhoneNumberTypes
ControlSource: PhoneNumberTypeID
ColumnCount: 2
ColumnWidths: 0";1"
BoundColumn: 1
My preference would be to eliminate PhoneNumberTypeID and simply save the descriptors (Office, Home, Mobile) or at least use O, H, M instead of 1, 2, 3.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks, June7. I've implemented your changes, including the suggestion to eliminate PhoneNumberTypeID as an autonumbered primary key in the PhoneNumberTypes table. Now, PhoneNumberTypeID is the primary key but a text field containing records "Office", "Home", and "Mobile". There's no PhoneNumberType field now. After a tweak to another table to accommodate this change, the entire database now works just the way I want! I can specify with a combo box the phone no. types, and all new contacts and data are saved properly to the tables.
The reason I wanted an autonumber primary key for phone no. types was that this database is actually a much simplified version of a larger database I need to build, where instead of contacts with multiple phone numbers it will be peoples' obituaries with multiple obituary notices in different newspapers. Main form has data on deceased, subform has data on multiple obituaries. I built that, but it was so complex it was hard to fix, so I built a simple model with similar requirements. Now (thanks to your and Dals' help) all I have to do is translate the simple model's setup to the big database. For that one, I'm thinking I'll need to reinstate the autonumber primary key to facilitate searches; I'll see.
Anyway, thank you again June7 and Dal, for your help. You'll probably hear from me again if I have trouble doing the porting over to the big DB. I've enclosed the properly functioning version in case others need the code.