MSAccess-Changing subforms with buttons on the main form?

Does any body know how to do this? I can open a new form with a button placed on the form with the following code -


stDocName = "DaltonTest"
DoCmd.OpenForm stDocName, , , stLinkCriteria


But how do I direct it so it opens in the subform area. Any help would be appreciated.

Comments

  • Force an OnLoad() in the opened for to load subform also.



    : Does any body know how to do this? I can open a new form with a button placed on the form with the following code -
    :
    :
    : stDocName = "DaltonTest"
    : DoCmd.OpenForm stDocName, , , stLinkCriteria
    :
    :
    : But how do I direct it so it opens in the subform area. Any help would be appreciated.
    :



  • : stDocName = "DaltonTest"
    : DoCmd.OpenForm stDocName, , , stLinkCriteria

    Try:

    stDocName = "DaltonTest"
    SubForm.SourceObject = stDocName




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories