Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with subform

Status
Not open for further replies.

topgeek

MIS
Oct 28, 2001
59
GB
I have a subform on my main form and when I click on the text box in the sub-form I get the following message:

"You tried to assign the NULL value to a variable that is not a Variant data type".

I can clear the error and enter the text into the sub-form, the data is writen to the table but does not appear in the sub-form when I go back to it?

Any one have an idea what this error message means.?

Many Thanks
 
Somewhere in the subform's code you populate a string variable with the value of an unitialized control.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
the data is writen to the table but does not appear in the sub-form when I go back to it?

Are the main form and subform linked properly? Usually, the LinkMaster and LinkChild fields are used to accomplish this.

Open the from in design mode. Make sure the Properties window is open (from the menu, "View" -> "Properties")

Select a field on the main form and then select the subform. Look at the "Data" tab in the Properties window -- you should see entries for the LinkChild and LinkMasteyr fields. If not select the LinkChild field and click on the "..." command button that appear to the left to open the Subform Field Linker window. Select the field(s) used to tie the main form to the child form.

Hint:
If you define your relationships first (from the menu, "Tools" -> "Relationships"), then when you create a form / subform, linkage will be automatically created by Access.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top