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

ahmad_rmh

Member
Local time
Today, 08:13
Joined
Jun 26, 2022
Messages
125
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: 39
  • 2.GIF
    2.GIF
    94 KB · Views: 46
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:13
Joined
Oct 29, 2018
Messages
19,201
Hi. Welcome to AWF!

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

ahmad_rmh

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

Attachments

  • 1.GIF
    1.GIF
    97.6 KB · Views: 45
  • 2.GIF
    2.GIF
    94 KB · Views: 45

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:13
Joined
May 21, 2018
Messages
6,444
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