Solved Cacading combobox issue in main and sub form (1 Viewer)

ahmad_rmh

Member
Local time
Today, 13:04
Joined
Jun 26, 2022
Messages
243
Dear experts,

I have a form with sub form. The theme is that the main warehouse has sub warehouses and each sub warehouse has its own products list. The detail is as follows,
Products receipt form with sub form.
1. ReceiptMain, 2. ReceiptSub.
Main form has sub warehouses combobox and sub form has products combobox.
I want to correlate the sub form combobox with the sub warehouses combobox in the main form.

I have made query on sub form productslist combobox.
ItemsListID, ItemsListName, warehousesId.
Criteria has been defined on WarehousesId as;
[Forms]![ReceiptMain]![warehousesId]
, and after update event on main form combobox has been defined.

Sub form combobox is showing items list as per the warehouses products list.

But the issue which i am facing is that after data entry when i change warehouse name it clears only products names not the others fields of quantity and so on. and on rechange to original warehouse it shows again products.

Kindly suggest the solution please.

when i change value in the main combobox the subform table shows the entries, i want to clear data related to that record, i don't know how to write code to clear the contents in the sub form.
 

Attachments

  • 1.GIF
    1.GIF
    97.6 KB · Views: 125
  • 2.GIF
    2.GIF
    94 KB · Views: 126
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 03:04
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to AWF!

Are you able to post a sample db to demonstrate the problem?
 

ahmad_rmh

Member
Local time
Today, 13:04
Joined
Jun 26, 2022
Messages
243
I have attached the samples where i am getting issue
 

Attachments

  • 1.GIF
    1.GIF
    97.6 KB · Views: 125
  • 2.GIF
    2.GIF
    94 KB · Views: 132

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:04
Joined
May 21, 2018
Messages
8,463
A combobox only shows values that are included in the rowsource. If you modify the rowsource and it filters out previously selected values then those values will not show even though they exist. If that is your issue see here
This is normally seen in a continuous form where you cascade in each record, but the same would happen if you cascade from the main form.
 

Users who are viewing this thread

Top Bottom