This is driving me potty - a couple of times I have had it where can debug past a line so I think it's working then later throws up an error on same code.
I have 3 forms currently
When I Select something on the first one I want the bottom subform to update so I have code on on current and tried about a bazillion ways of getting it to work and nothing seems to work and allow the following code to run which works fine elsewhere
Private Sub Form_Current()
Set frm2 = Me.Parent![FrmForecastDeptForm]
For Each ctrl In frm2
If ctrl.Tag = "Hide" Then ctrl.ColumnHidden = True
Next ctrl
The Parent form is called MonthlyDeptTest but if I use that it says not recognized. The top subform is called FrmMonthDeptQuery and the bottom one is called FrmForecastDeptForm with source object ForecastDeptForm
If I try putting Me.Parent![FrmForecastDeptForm].Form I get
If I leave out form then it continues but then errors with
Me.Parent.Controls![FrmForecastDeptForm].Requery runs fine
Have tried Me.Parent.Controls![FrmForecastDeptForm] and Me.Parent.Controls![FrmForecastDeptForm].Form and neither of those work
If I try something including Forms!["MonthlyDeptTest"] I get error:
I have tried googling and still stuck so on here asking for help before I go spare. What was really annoying was when it worked with one combination and I thought had solved it and then later go to run same code and it no longer ran and sprung up an error - grrrrr
Thanks Experts
Paul
I have 3 forms currently
When I Select something on the first one I want the bottom subform to update so I have code on on current and tried about a bazillion ways of getting it to work and nothing seems to work and allow the following code to run which works fine elsewhere
Private Sub Form_Current()
Set frm2 = Me.Parent![FrmForecastDeptForm]
For Each ctrl In frm2
If ctrl.Tag = "Hide" Then ctrl.ColumnHidden = True
Next ctrl
The Parent form is called MonthlyDeptTest but if I use that it says not recognized. The top subform is called FrmMonthDeptQuery and the bottom one is called FrmForecastDeptForm with source object ForecastDeptForm
If I try putting Me.Parent![FrmForecastDeptForm].Form I get
If I leave out form then it continues but then errors with
Me.Parent.Controls![FrmForecastDeptForm].Requery runs fine
Have tried Me.Parent.Controls![FrmForecastDeptForm] and Me.Parent.Controls![FrmForecastDeptForm].Form and neither of those work
If I try something including Forms!["MonthlyDeptTest"] I get error:
I have tried googling and still stuck so on here asking for help before I go spare. What was really annoying was when it worked with one combination and I thought had solved it and then later go to run same code and it no longer ran and sprung up an error - grrrrr
Thanks Experts
Paul