silentwolf
Active member
- Local time
- Today, 02:41
- Joined
- Jun 12, 2009
- Messages
- 575
Hi again,
Sorry beeing a pain and ask again for your help and advice!
It is a extention to my previous thread on Finding Articles easily in long list of Items where CJ_London did a amazing job of helping me!!
However it would be just a little nicer if I can select in a sfmAuftragModelle first the "Lieferant" = cboLieferant and then show only the cboModelle wich belong to the cboLieferant. Lieferant=Supplier or Manufacturer... and Modell is well Model..
The issue I have is that I got tbl_Lieferant to tbl_Modell 1:N relationship
then tbl_AuftragModelle linked to tbl_Modelle and tbl_Auftraege
I got a subform sfm_AuftragModelle where I would like to be able to pic the "Lieferant" and then the Modell and then add the additional Fields from tbl_AuftragModelle.
I add a DataStructure below.
To create a Cascading Combobox in a Single Form is not a Problem when tbl_Lieferant is picked with cboLieferant and update the cboModel
but as there are tblLieferant to tblModel to tblAuftragModel I have not beeing able to put all into one Subform..
I would like to have it as a Continious Form as you can see all Models related to the appropiate "Auftrag"="Order"
This is what I tried so far in the sfmAuftragModel
All this Code is based on CJ_London Code for Cascading Comboboxes... well I modified it so that is why is not working lol
Not that someone things I am saying CJ_London done anything wrong!
Or is there a better way of doing this so it is also visible what "Models" are used in each "Auftrag" (Order)
Struggling with RowSource and how it all needs to be put together..
Currently it will update all records in the Subform with the first cboLieferant picked...
Sorry beeing a pain and ask again for your help and advice!
It is a extention to my previous thread on Finding Articles easily in long list of Items where CJ_London did a amazing job of helping me!!
However it would be just a little nicer if I can select in a sfmAuftragModelle first the "Lieferant" = cboLieferant and then show only the cboModelle wich belong to the cboLieferant. Lieferant=Supplier or Manufacturer... and Modell is well Model..
The issue I have is that I got tbl_Lieferant to tbl_Modell 1:N relationship
then tbl_AuftragModelle linked to tbl_Modelle and tbl_Auftraege
I got a subform sfm_AuftragModelle where I would like to be able to pic the "Lieferant" and then the Modell and then add the additional Fields from tbl_AuftragModelle.
I add a DataStructure below.
To create a Cascading Combobox in a Single Form is not a Problem when tbl_Lieferant is picked with cboLieferant and update the cboModel
but as there are tblLieferant to tblModel to tblAuftragModel I have not beeing able to put all into one Subform..
I would like to have it as a Continious Form as you can see all Models related to the appropiate "Auftrag"="Order"
This is what I tried so far in the sfmAuftragModel
Code:
Private Sub cboLieferant_AfterUpdate()
cboModel = ""
cboModel_AfterUpdate
End Sub
Code:
Private Sub cboModel_AfterUpdate()
Me.Requery
End Sub
Code:
Private Sub cboModel_GotFocus()
'use this technique where the combo box does not display the bound column once selected
popProduct (True) 'technique 2
End Sub
Code:
Private Sub popProduct(Filtered As Boolean) 'technique 2
Dim sqlstr As String
'use this technique where the combo box does not display the bound column once selected
'refresh the rowsource to show all options
'no need to sort since this is a simple lookup, never displayed as a list
sqlstr = "SELECT Mod_ID, Mod_Bezeichnung FROM tbl_Modell"
cboModel.RowSource = sqlstr
cboModel.Requery
'now change the rowsource filtering to include the upstream combos
'- this will only affect the current combobox until it loses focus
If Filtered Then
'wait for initial refresh to complete
DoEvents
'apply filter and order - note the use of the combobox name
'- this only works if the rowsource is written directly as sql and not as a query
cboModel.RowSource = sqlstr & " WHERE Mod_Lief_IDRef=[cboLieferant]"
End If
End Sub
Private Sub Form_Load()
popProduct (False) 'technique 2
End Sub
All this Code is based on CJ_London Code for Cascading Comboboxes... well I modified it so that is why is not working lol
Not that someone things I am saying CJ_London done anything wrong!
Or is there a better way of doing this so it is also visible what "Models" are used in each "Auftrag" (Order)
Struggling with RowSource and how it all needs to be put together..
Currently it will update all records in the Subform with the first cboLieferant picked...
Attachments
Last edited: