yahooooo
asked on
How to access datasheet subform on a tab control
Hello experts
Im strugling with accessing a subform via VBA which is placed on another form on a tab control.
So the form Im looking for is called: 'TreeLevels subform'. It is placed on form: FormTagValidation which is on tab control's ("TabCtl0") page - 'Validation'.
Tab control is on form 'FirstStage'.
So to e.g. set focus on FormTagValidation or to set focus on page validation I need to use code:
Well I cant make it working for 'TreeLevels subform'
My ultimate goal is to apply query to this subform's RecordSource.
cheers
Im strugling with accessing a subform via VBA which is placed on another form on a tab control.
So the form Im looking for is called: 'TreeLevels subform'. It is placed on form: FormTagValidation which is on tab control's ("TabCtl0") page - 'Validation'.
Tab control is on form 'FirstStage'.
So to e.g. set focus on FormTagValidation or to set focus on page validation I need to use code:
Forms!FirstStage!FormTagValidation.SetFocus
Forms!FirstStage.TabCtl0.Pages.Item("Validation").SetFocus
Well I cant make it working for 'TreeLevels subform'
My ultimate goal is to apply query to this subform's RecordSource.
cheers
check the "NAME" of the subform Control (the control that housed the subform)
and use it in the expression instead of using the name of the subform
and use it in the expression instead of using the name of the subform
Can you provide a screenshot of the forms in question? It sounds like you might actually have a main form, subform, nested subform configuration.
<thats FormTagValidation which hosts subform and no it doesnt work>
i dd not mentioned the name of the form that housed the subform,
i said, the control in form "FormTagValidation" that housed the subform
i dd not mentioned the name of the form that housed the subform,
i said, the control in form "FormTagValidation" that housed the subform
Where are you attempting to do this from? Is there a control on the main form, or an even on the main form?
You should be able to use:
Forms!FirstStage!FormTagVa lidation.F orm.Record source = queryName
or
Form_FirstStage.FormTagVal idation.Fo rm.Records ource = queryName
You should be able to use:
Forms!FirstStage!FormTagVa
or
Form_FirstStage.FormTagVal
ASKER
@capricorn
i tried both:
Forms!FirstStage!TabCtl0!F ormTagVali dation![Tr eeLevels subform].SetFocus
Forms!FirstStage!TabCtl0![ TreeLevels subform].SetFocus
@Fyed
Im trying to do that from another tab's form. It works find if Im on this form through me.[treelevels subform]...
There is a tab control on the main form
i tried both:
Forms!FirstStage!TabCtl0!F
Forms!FirstStage!TabCtl0![
@Fyed
Im trying to do that from another tab's form. It works find if Im on this form through me.[treelevels subform]...
There is a tab control on the main form
yahooooo,
did you look at the second link i posted above?
there is no need to reference the Tab Control to refer to the subform.
did you look at the second link i posted above?
there is no need to reference the Tab Control to refer to the subform.
ASKER
Yes i know that. Got confused with that control u asked for. Thought you meant that tab control. It's late, deadline in few hours and im sick so good excuse I guess ;)
I created this subform by drag and drop a table on FormTagValidation. Not sure if there is any control over there.
I guess I could move all my controls and this subform straight to the tab control (so remove FormTagValidation) and that should work, but that would be a lot of work...
I created this subform by drag and drop a table on FormTagValidation. Not sure if there is any control over there.
I guess I could move all my controls and this subform straight to the tab control (so remove FormTagValidation) and that should work, but that would be a lot of work...
upload a copy of your db..
ASKER
Hope that helps. I replaced original data with few dummy rows and removed forms which weren't relevant
Maint-Build-Tool-v0.04---test2.accdb
Maint-Build-Tool-v0.04---test2.accdb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looks like I deleted too many things ;)
I created a button on 'treeview' tab. What I need is perform any operation on TreeLevels subform from treeview. that could be for example: to set focus on TreeLevels subform or to update TreeLevels subform's recordset basing on some query. See commented code in an onclick event
thanks
Maint-Build-Tool.accdb
I created a button on 'treeview' tab. What I need is perform any operation on TreeLevels subform from treeview. that could be for example: to set focus on TreeLevels subform or to update TreeLevels subform's recordset basing on some query. See commented code in an onclick event
thanks
Maint-Build-Tool.accdb
did you look at the rev i uploaded? comment on that first .
ASKER
ok I addapted it to my solution :) works great
so what I was looking for is:
thanks
so what I was looking for is:
Forms!FirstStage!FormTagValidation.Form![TreeLevels subform].Form.RecordSource = "WrongParent"
and what I missed was " .Form " after FormTagValidationthanks
see my first post at http:#a39291233
ASKER
silly me. I havent noticed that bit :/ sorry for wasting your time bud
Forms!FirstStage!FormTagVa
see this links for reference
http://access.mvps.org/access/forms/frm0031.htm
http://access.mvps.org/access/forms/frm0025.htm