Solved Update Control in TabControl from another form

silentwolf

Active member
Local time
Today, 08:49
Joined
Jun 12, 2009
Messages
644
Hello guys,

just not haveing any luck updateing a combobox from another form.

I open a form to select a Contact, once this contact is selected I like to update a combobox in a tabcontrol.

Code:
Forms![frmKontaktHF]![tabKontakt]![pagAuftrag]![sfmKontaktAuftraege]![cboKontakt] = Me.Kont_ID


So it is MainForm, TabControlName, PageName, SubformName, ComboboxName = me.Kont_ID

As you can see I have included all Controls from top to bottom

Can someone tell me what needs to be changed in order to update the cboKontakt when I select a Kontakt from another form.


I have tried leaving some out and so on but either I get not found or Procedure Let and Set Errors..


Thanks for help!

Albert
 
As it happens, ALL controls on a form with a Tab control are simply part of the form containing the Tab. That is, when addressing an item on the Tab, the Tab control is not an element of its reference name. However, you DO have a subform. I'm going to take a guess here and suggest:

Code:
Forms![frmKontaktHF]![sfmContactAuftraege].Form.[cboKontakt] = Me.Kont_Id

In other words, Forms ! main-form-name ! name-of-subform-control . Form . name-of-control-on-subform

To be clear, you are asking for the control on the form that is contained by the subform control, NOT the name of the form that was loaded to the subform control. That name never enters into the picture because of the use of ...Form... in the selection string.
 
Hi Doc_Man,

thanks for helping me!
Unfortunatelly I made a mistake and therefor your solution did not work.

However I did manage with your help to solve it like that.

Code:
Forms![frmKontaktHF]![sfmKontaktAuftraege]![sfmAuftragsDetails].Form.[cboKontakt] = Me.Kont_ID

The reason behind my code is that the subform is within the subform..

So thank you and sorry for not thinking about it at the start of the post!
 
Interesting... two layers of subforms? I'll admit I'm surprised you didn't need a second .Form. in that sequence, but if it worked, great. I think that means that somehow the default property of a subform control is the form loaded to that control I would not not have guessed that since the .Form. is required to get to the control in that next layer.

In any case, I'm glad I was able to at least give you a hint in the right direction.
 
Just to remind you - tables store data. Forms do not store data. So when you change a field on one form, you should not have to change a field on a different form to correspond to the first.

If you have this particular piece of data in two tables, you have a design flaw and we should be addressing that.
 
Hi Pat,
Just to remind you - tables store data. Forms do not store data
Yes thanks for reminding me but that I do understand. It is about getting the ID of a "Contact" back into a Dataentry Form.

However it is a little different the datadesign and properbly not 100% right but I do not really be able to set it up better.
But I am working on it.

Maybe I should address it in another post and see if someone has a suggestion of creating the datastructure better.

Cheers
 
We are always happy to offer our opinions:) Post the schema if you want us to look at it. It is easier with data but not always necessary so you could just upload empty tables. Real data just makes it easier to visualize what you are trying to do.
 
Hi Pat,
ok I did change it to English Version for better understanding.

Here is the file many thanks for taking a look as I am working since days on it and not seam to make a good model out of it.
But I will post it to the new DataStructure Question


Cheers
 

Users who are viewing this thread

Back
Top Bottom