Hello,
I've met with problem when Access passes NULLs as parameters when executing the stored procedures used as data source for the forms
I have 3-level datasheet type form
There are 3 forms on a form: the main form, subform and sub-subform
It can be represented as Country is the main form, City - is the subform, street is sub-subform
Country has the data source as a simple SP without any parameters with simple SELECT statement in the SP like SELECT Country, CountryID FROM dbo.Country
The City form has the SP with @CountryID input parameter which returns all the Cities of the country.
There is only InputParameters propery is set for the form. And the InputParameters=@CountryID=Forms!Country!CountryID
Finally there is the sub-subform called Street to show all the streets of a city af a country
It has the SP with input parameters @CountryID and @CityID and in InputParameters they set as
InputParameters=@CountryID=Forms!Country!CountryID, @CityID=Forms!Country!City!CityID
The approach works but not stable. After several attempts expanding the forrms Access begins setting the @CityID to NULL when executing the SP for the Street form. As result the sub-subform is empty. The only cure for this is reopening the forms.
I was trying to find an event for the plus (+) which opens subform from the main form's record to correct the input parameters to be correct. But my attempts were unsuccessful. There are only the mouse's events available like MouseMove, MouseDown and MouseDown from the main form and in addition OnCorrent and OnResize of the subform.
But the mouse's events are inconvinient to use, and the OnCurrent and OnResize events of the subform are happened when the data already got from the server
I've met with problem when Access passes NULLs as parameters when executing the stored procedures used as data source for the forms
I have 3-level datasheet type form
There are 3 forms on a form: the main form, subform and sub-subform
It can be represented as Country is the main form, City - is the subform, street is sub-subform
Country has the data source as a simple SP without any parameters with simple SELECT statement in the SP like SELECT Country, CountryID FROM dbo.Country
The City form has the SP with @CountryID input parameter which returns all the Cities of the country.
There is only InputParameters propery is set for the form. And the InputParameters=@CountryID=Forms!Country!CountryID
Finally there is the sub-subform called Street to show all the streets of a city af a country
It has the SP with input parameters @CountryID and @CityID and in InputParameters they set as
InputParameters=@CountryID=Forms!Country!CountryID, @CityID=Forms!Country!City!CityID
The approach works but not stable. After several attempts expanding the forrms Access begins setting the @CityID to NULL when executing the SP for the Street form. As result the sub-subform is empty. The only cure for this is reopening the forms.
I was trying to find an event for the plus (+) which opens subform from the main form's record to correct the input parameters to be correct. But my attempts were unsuccessful. There are only the mouse's events available like MouseMove, MouseDown and MouseDown from the main form and in addition OnCorrent and OnResize of the subform.
But the mouse's events are inconvinient to use, and the OnCurrent and OnResize events of the subform are happened when the data already got from the server