tfurnivall
Registered User.
- Local time
- Today, 03:45
- Joined
- Apr 19, 2012
- Messages
- 81
I'm not certain quite how to express this, but let's take a stab.
All forms and controls are unbound. (See below)
I have a situation with two object classes (let's call them Studies and Surveys). Each class has an independent existence, but surveys 'belong' to a study. I need to be able to look at Surveys by themselves, or as part of a study. Each class has a whole form to itself. A study has a button that allows me to limit the selection of surveys to those which belong to the study.
The code for the "Surveys" button on the Study form includes the following:
This works fine - and gives me a blank form with the two fields set up.
Now I'm trying to go one step beyond this, and have the first of the Surveys visible.
So happens I have a routine on the form called BRGoToFirst. This calls a routine called BRSetUpBrowse, which depends on a routine called BRSetBrowseObject, which defines all the parameters for a Browse. So I add the following right after the last line of code above:
BRSetBrowseObject is called as part of the Form.Load procedure.
When I trace execution I see the DoCmd.BrowseTo execute, and the Survey form gets loaded. In addition, the BRSetBrowseObject routine executes, setting the browse objetc to a Survey (and all the goodies associated with it).
I also see control return (briefly) to the code for the surveys button (the lines that poke values into fields on the form - Study ID and name, and do some control management.
Here's my problem.
The Form.Load procedure operates fine.
The additional lines in the Study form operate fine, and produce the desired result. However, all the setting of browse parameters has disappeared.
It's AS IF the form instance that I loaded has been replaced by another. Except that, the values I poked into it are all there. So, it must be the same instance of the form, right? Except that some control values are affected, but a global variable has been wiped out!
I'm totally stumped about how even to debug this situation. (I'm guessing a lab situation, probably, but that's a lot of effort ). Do any of the folks here have any ideas?
Or do you think there's a chance of getting MS to implement inheritance properly?
Tony
PS I realize that this is probably the 'cost' of breaking away from Microsoft's paradigm of how a User Interface should operate - trouble is, I have my own ideas about that
.
All forms and controls are unbound. (See below)
I have a situation with two object classes (let's call them Studies and Surveys). Each class has an independent existence, but surveys 'belong' to a study. I need to be able to look at Surveys by themselves, or as part of a study. Each class has a whole form to itself. A study has a button that allows me to limit the selection of surveys to those which belong to the study.
The code for the "Surveys" button on the Study form includes the following:
Code:
DoCmd.BrowseTo acBrowseToForm, "STDY_SurveyDesignForm"
' Load study fields into the target form
Form_STDY_SurveyDesignForm.lblStudyID.Caption = StudyID
Form_STDY_SurveyDesignForm.lblStudyName.Caption = StudyName
' Adjust visibility of targetform controls
Form_STDY_SurveyDesignForm.cmdQuestions.Visible = True
Form_STDY_SurveyDesignForm.cmdBrowseSurvey.Visible = True
Form_STDY_SurveyDesignForm.cmdSurveyAction.Visible = True
Form_STDY_SurveyDesignForm.cmdSurveyAction.Caption = "New Survey"
Now I'm trying to go one step beyond this, and have the first of the Surveys visible.
So happens I have a routine on the form called BRGoToFirst. This calls a routine called BRSetUpBrowse, which depends on a routine called BRSetBrowseObject, which defines all the parameters for a Browse. So I add the following right after the last line of code above:
Code:
Form_STDY_SurveyDesignForm.BRGoToFirst
When I trace execution I see the DoCmd.BrowseTo execute, and the Survey form gets loaded. In addition, the BRSetBrowseObject routine executes, setting the browse objetc to a Survey (and all the goodies associated with it).
I also see control return (briefly) to the code for the surveys button (the lines that poke values into fields on the form - Study ID and name, and do some control management.
Here's my problem.
The Form.Load procedure operates fine.
The additional lines in the Study form operate fine, and produce the desired result. However, all the setting of browse parameters has disappeared.
It's AS IF the form instance that I loaded has been replaced by another. Except that, the values I poked into it are all there. So, it must be the same instance of the form, right? Except that some control values are affected, but a global variable has been wiped out!
I'm totally stumped about how even to debug this situation. (I'm guessing a lab situation, probably, but that's a lot of effort ). Do any of the folks here have any ideas?
Or do you think there's a chance of getting MS to implement inheritance properly?
Tony
PS I realize that this is probably the 'cost' of breaking away from Microsoft's paradigm of how a User Interface should operate - trouble is, I have my own ideas about that
