Depending combos

Skyjunk

New member
Local time
Today, 18:27
Joined
Aug 16, 2006
Messages
8
I am making a Invoice DB. I have made a combo for Suppliers which takes data from SuppliersTable and data is recorded in InvoiceTable. I have another Combo for Services which takes data from SuppliersTable and records up in InvoiceTable. And I have another field (PaymentPeriod) dependent on ServiceCombo

I want to make Services Combo dependent on Supliers.

How can I do that?

Combo 1 = SuppliersCombo
SuppliersTABLE: suppliers data origin Field: SupplierMaster
InvoiceTable: supplier data destination Field: Supplier

Combo 2= ServiceCombo dependent on Suppliers Combo
SuppliersTABLE: suppliers data origin Field: ServiceMaster
InvoiceTable: service data destination Field: Service


Form Field: PaymentPeriod dependent on ServiceCombo
SuppliersTABLE: suppliers data origin Field: PaymentPeriodMaster
InvoiceTable: paymentperiod data destination Field: paymentperiod

How can I do these dependent?

I hope I explainned myself clearly, I am access first timer.
 
Almost Works

Hello

I did what the link told me and it almost worked. I get the combo to be dependent on the other however in the form, after selecting the first combo, the dependent combo shows the posibilities blank.

I checked and it works because in the table de 2nd combo chosen option is recorded. However I cannot see what choice I have to select from.

If I erase the AfterUpdate procedure, this stops happening and I am able to see the 2nd combo different options (however it is not dependent anymore).

What could be happening?

Thank you
 
Look at the ColumnCount and ColumnWidth properties on the Format tab of the properties sheet for the 2nd ComboBox. Compare them to the same properties on the 1st ComboBox.
 
After re-reading your post, how about posting the code in the AfterUpdate event of the 1st ComboBox?
 
I have checked the columns format and it seems it has nothing to do with it or it seems to be ok.

The code was already posted in the Afterupdate event of the 1st Combo.

Let me repet the situation just in case.PROBLEM:

2nd Combo is dependent of 1st Combo (with a code in Afterupdate event in 1st Combo).

On the Form, once the selection has been made on the 1st Combo, the 2nd Combo lets you choose among the existing options, but they appear blank. Once you select the option in 2nd Combo, it is recorded in the destiny Table.

So it seems to be working, however the options are not displayed on the Combo, so you do not know what you are choosing.

Anybody can help?
 
The code was already posted in the Afterupdate event of the 1st Combo.
I do not see the AfterUpdate event code in this thread. Please copy and paste it into a post so we can see it.
 
The table and form names are in Spanish, but the principle is the same.

Private Sub ComboPROVEEDOR_AfterUpdate()
On Error Resume Next
ComboSERVICIO.RowSource = "Select Tabla_PROVEEDORES.ServicioMaestro " & _
" FROM Tabla_PROVEEDORES " & _
" WHERE Tabla_PROVEEDORES.ProveedorMaestro = '" & ComboPROVEEDOR.Value & "' " & _
" ORDER BY Tabla_PROVEEDORES.ServicioMaestro;"
End Sub


THANKS
 
If you are not dynamically changing the RowSource of the ComboPROVEEDOR ComboBox then all you need to do is Requery the ComboPROVEEDOR ComboBox rather than replacing the RowSource.
 
I do not follow you. I am kind of new and green to access.

Just in case this clarifies what I´m trying to do : I am desingning a Suppliers´s invoice database, that would use a form to record invoices received. There is a separated table for Suppliers that specifies the payment period for the different services provided by each supplier. In the form I have included a combobox for suppliers and I want that once I choose the supplier, the next combo would only show me the services of that supplier.

At this point is where I am at. I use the Afterupdate event code I told you but It does not work ok as I said.

After I achieve this, what I want to do is choose the service from the 2nd combo box so that would automatically give me the payment period (and record it on the main table with the rest of the data).

That´s when I asked about cascading combos, but I cannot make it work properlly. What is wrong with my AfterUpdate Event? Or how can I do this?

Thanks a lot for your time and help
 
Last edited:
SkyJunk,
I understand what you would like to accomplish. Is there any chance you can post your db so we can look at it? Remove any sensitive data but leave enough data to demonstrate the issue.
 
DataBase

Hi

The DB has no invoice nor payment data. I am using excel and data is becoming to much for excel. I am designing it based on what I have on excel and what I would like it to be.

I have translated some of the tables and most important concepts into English so it is easier for you to understand.

Thanks a lot :)
 

Attachments

I made some changes. Am I on the right track? If so, can you take it a little further on your own?
 

Attachments

Great !

I made some minor adjustments and it works as I wanted.

THANKS A LOT!!!
 
Outstanding!! Thanks for posting back with your success.
 

Users who are viewing this thread

Back
Top Bottom