Good Morning,
I have a form based on a query. I am using two fields from the query. I
have inserted a second form as a subfom. It is based on a table. The
subform works fine when I open it by itself, but that will not help me
because I want to have the records associated with the table in the
aforementioned query. I used the wizard to create the Form/Subform
relationship. The form/subform looks fine, I but get the following error
message when I try to enter data into the first field in the subform:
"You tried to assign the NULL value to a variabe that is not a Variant data
type"
The main form is not updatable, I use it to know what main form record I am
working on. I don't know what other info you might need. I have made
subforms many times before in what I thought was the same way, but I must
have done something different this time. Any help would be appreciated. I
checked the data sources in both forms and I checked the Link Child and Link
Master Fields and they seem correct.
One last thing. I can Ok the error message and go on adding data to the
form. It accepts the data and if I look at the table the data is there.
But it does not appear in the subform if I close the Form and then reopen
it. So the linkage must not be right. I have a relationship set in the
Relationship screen (Tools Menu) and changing the join type does not seem to
make a difference.
Thanks,
Scott B
Dirk Goldgar - 04 Jul 2005 19:32 GMT
> Good Morning,
>
[quoted text clipped - 23 lines]
> relationship set in the Relationship screen (Tools Menu) and changing
> the join type does not seem to make a difference.
I think you're probably right, and the error is in the Link Master/Child
fields, or else in the recordsource of the subform. Please post the
values of these properties, and also the SQL of the main form's
recordsource.

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)