Re-reading this thread, I wonder if this is a much simpler problem.
describe, and would then continue anyway.
problem is there. For example, if the combo is bound to a Number field, but
the bound column is zero-width, you won't see the number, just the text. If
the number field. Clearing the Default Value would solve the problem.
value also.
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
news:1166726185.158072.163340@73g2000cwn.googlegro ups.com...
Quote:
Allen,
>
I tried everything that you suggested and I'm still having the same
problem as previously stated.
>
The other thing I didn't mention was that when you first click on the
combobox in subform2 when you move to select a choice it blanks out. I
don't know if that gives a clue as to what's going on or not.
>
But at this point I'm still stuck.
>
Allen Browne wrote:
>Make sure the Name AutoCorrect boxes are unchecked under:
> Tools | Options | General | Name AutoCorrect
>Explanation of why:
>
http://allenbrowne.com/bug-03.html
>>
>Then compact the database:
> Tools | Database Utilities | Compact/Repair
>>
>Double-check the name of the text box on your main form matches the name
>in
>the LinkMasterFields property of the problem subform.
>>
>Check that the LinkChildFields property refers to a text box in the
>subform
>(not merely a field in the subform's RecordSource.)
>>
>If that all checks out okay, close Access. Make a backup copy of the
>file.
>Decompile the database by entering something like this at the command
>prompt
>while Access is not running. It is all one line, and include the quotes:
> "c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
> "c:\MyPath\MyDatabase.mdb"
>Then compact again.
>>
>"Ecohouse" <vindaloo1@netzero.comwrote in message
>news:1166628163.758745.108890@80g2000cwy.googlegr oups.com...
Allen,
>
I tried your method. And the subforms are working in sync properly.
But when I go to add a record to subform2 I'm getting the following
error - The link MasterFields property setting has produced this
error: "The object doesn't contain the Automation object
txtTrainingModuleTopicSK."
>
I checked the Masterfield in subform2 and it is still set to
txtTrainingModuleTopicSK. Any ideas? It doesn't matter what field I
try to enter data in on subform2, it returns the same error message.
>
Thanks again for the help.
>
>
Ecohouse wrote:
>Thanks for the help Allen. The subform isn't based on a query, only
>one table. If I add the control on the main form I assume that I have
>to requery it form subform1 whenever I move to a new record?
>>
>Once the new control receives the new value will it automatically
>update subform2?
>>
>>
>Allen Browne wrote:
Hmm. There's a few possible things here.
>
You might try adding a text box to the main form, with properties:
Control Source
=[subTrainingModule].[Form]![TrainingModuleTopicSK]
Name txtTrainingModuleTopicSK
Format General Number
(Omit the Format if it's not a Number field.)
You can then use that name in the LinkMasterFields property of the
2nd
subform.
>
What that does is to set the 2nd subform to be dependent on a text
box
on
the main form, rather than a control in another subform. You might
find
that
this dependency (the normal one Access expects for subforms) solves
the
timing problem.
>
If that doesn't work, is subform2 based on a query that contains
more
than
one table? If so, there are a couple of other potential issues.
a) Double-check that the key field in the query is from the table
you
actually want to write the record to. If it's from the other table,
the
attempt to assign the value will fail and the value of the real key
field
won't be set.
>
b) Open the other table in design view (i.e. the one you are not
appending
the record to.) Are there any fields with a Default Value set? If
so,
delete
the Default Value. Access can misinterpret this and try
(unsuccessfully) to
assign the value, even though you are not trying to add a record to
that
table. Any controls on your subform that come from the other
table(s)
may
also need their Default Value cleared.
>
"Ecohouse" <vindaloo1@netzero.comwrote in message
news:1166556005.177742.113370@a3g2000cwd.googlegro ups.com...
>I have a main form with two subforms. The first subform has the
>child
link to the main form identity key.
>
subform1 - Master Field: SK
Child Field: TrainingMasterSK
>
The second subform has a master-child link to the first subform.
>
subform2 - Master Field:
subTrainingModule.Form!TrainingModuleTopicSK
Child Field: TrainingModuleTopicSK
>
All of the links are working and I can see the correct data. I'm
able
to enter new records on the first subform with no problem.
>
But when I go to enter a record in the second subform I get the
following error message: "The value you entered isn't valid
forthis
field". This is happening in the BeforeInsert event.
>
Once I move past the message box then the data in that controls
shows
up. When I check the table that this subform is using I can see
that
when a new record is created the TrainingMasterSK field is
populated
but the TrainingModuleTopicSK field isn't.
>
The TrainingMasterSK field comes from the main form and the
TrainingModuleTopicSK field comes from the first subform. And
because
the TrainingModuleTopicSK isn't being populated once the record is
saved there is no link to the first subform.
>
I'm under the assumption that the second subform should
automatically
fill in the TrainingModuleTopicSK field when a new record is
entered.
>
So at this point I have no idea what to do or how to get around
this
problem. Any help would be appreciated