Solved Active / Inactive Items List in combo box

ahmad_rmh

Member
Local time
Today, 23:40
Joined
Jun 26, 2022
Messages
243
On which event I have to call for inactive items so that it could show the previous records of transactions with main and subform. The screenshot is attached herewith for your info please.
 

Attachments

  • Inactive Items.PNG
    Inactive Items.PNG
    20.8 KB · Views: 106
I have solved through the following codes, Kindly suggest is this the correct way or suggest the best. thanks

Code:
Private Sub Form_Current()
Me.ItemsFK.RowSource = "SELECT ItemsPK, ItemsListName FROM tblItems ORDER BY ItemsPK;"
End Sub

Private Sub ItemsFK_GotFocus()
Me.ItemsFK.RowSource = "SELECT tblItems.ItemsPK, tblItems.ItemsListName, tblItems.IsActive, tblEntities.EntityPK FROM (tblCategories INNER JOIN tblItems ON tblCategories.CategoryPK = tblItems.CategoryFK) INNER JOIN tblEntities ON tblCategories.EntityFK = tblEntities.EntityPK WHERE (((tblItems.IsActive) = True) And ((tblEntities.EntityPK) = [Forms]![frmTransactionsMain]![MainWarehouseFK])) ORDER BY tblItems.ItemsPK;"
End Sub
 

Attachments

  • Inactive Items.PNG
    Inactive Items.PNG
    24.1 KB · Views: 100
  • ItemsList.png
    ItemsList.png
    29.3 KB · Views: 106
Last edited:
If you are using a field as a marker for activity, that is probably the most common method and is very commonly used.
 

Users who are viewing this thread

Back
Top Bottom