Solved How to filtering by List box as like cascading combo box (1 Viewer)

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
Hello Sir @arnelgp
Now facing another problem.
you need to look at the index (Unique) of table tblPayRollData on design view.
this index will prevent duplicate when adding record of same employee, month, and year.
Now Month table make UNIQUE :
Code:
SELECT tblMonths.ID
FROM tblMonths
WHERE (((tblMonths.ID)=[Forms]![frmCreateAppend]![cboMonths]));

Combine result is like October : "202210"
CaptureMonth.JPG

Year table
Code:
SELECT tblYears.Year
FROM tblYears
WHERE (((tblYears.Year)=[Forms]![frmCreateAppend]![cboYears]));
Captureyear.JPG

October Data has been updated !
When try to November data then give message that No record found !
But tblPayRollData is nothing November 2022 data.
Capturemsg.JPG
 

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
Hello Mr. @arnelgp . Hope, You are doing well
I having a problem with the data that Its always appended previous 2 months ago records.
In January I thought it was my mistake. February I do it carefully.
see picture.
Untitled-1.jpg

my questions, why everytime 2 months previous records have been taken ?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 05:48
Joined
May 7, 2009
Messages
19,249
you upload your db so i can troubleshoot.
 

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
Please check the post #18
My Ideas is MAX formula can work. But no sense which column is perfect to work.
I would like to taken latest records from table "tblPayRollData" .
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:48
Joined
Feb 19, 2002
Messages
43,602
Without seeing the table schema and the data, we can't tell what is causing the error message. Looks like you don't have the indexes defined correctly.

PS - you REALLY do not want columns named Year and Month. Both are function names and using them can result in strange errors in queries and code.
 

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
Without seeing the table schema and the data, we can't tell what is causing the error message. Looks like you don't have the indexes defined correctly.

PS - you REALLY do not want columns named Year and Month. Both are function names and using them can result in strange errors in queries and code.
Thanks for you reply.

You can see the table and data in the post #18,
I want to know, where do i mistake that appended query take first rows data only, Not taken latest updated data from the table "tblPayrolldata".
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 05:48
Joined
May 7, 2009
Messages
19,249
post #18 db, does not have "Employee Salary Editor" form.

about the append query, it has nothing to do with with any "calculation" you have.
it only append records from Employee records.
 

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
post #18 db, does not have "Employee Salary Editor" form.

about the append query, it has nothing to do with with any "calculation" you have.
it only append records from Employee records.
Thanks for your response.

I show the employee record editor form for understood records appended FIRST rows only.

Post # 18 attached database is worked perfectly. But problem is the taken records FIRST row only where I would like to taken latest update records each time appended.

For that I tried a subquery as using the MAX formula . Like ...
Code:
SELECT tblPayRollData.EmployeeID, Last(tblPayRollData.YearID) AS LastOfYearID, Last(tblPayRollData.MonthID) AS LastOfMonthID, Max(tblPayRollData.PayRollDate) AS MaxPayRollDate
FROM tblPayRollData
WHERE (((tblPayRollData.PayRollDate)=(SELECT MAX(PayRollDate)
             FROM tblPayRollData AS t
             WHERE t.EmployeeID = tblPayRollData.EmployeeID
               AND t.YearID = tblPayRollData.YearID
               AND t.MonthID = tblPayRollData.MonthID)))
GROUP BY tblPayRollData.EmployeeID;
But no sense how to connect with in the append query. because there are already same fields available.
 

SHANEMAC51

Active member
Local time
, 00:48
Joined
Jan 28, 2022
Messages
310
I show the employee record editor form
  • I didn't find where the PAGE_NO list is
  • used in three lists, multiple choice is applied - so far I ignored
  • the first three lists and the year and month I form a filter, which is called by the FILTER button
  • left the button - reset the filter
 

Attachments

  • ww1510.jpg
    ww1510.jpg
    128.5 KB · Views: 50
  • Payroll New Ver 2m15.accdb
    1.1 MB · Views: 58

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
  • I didn't find where the PAGE_NO list is
  • used in three lists, multiple choice is applied - so far I ignored
  • the first three lists and the year and month I form a filter, which is called by the FILTER button
  • left the button - reset the filter
Thanks for your response.
No, I dont need filter, it is already done.

I required, APPENDED query.
When i run append query then it is taken Firstly recorded Year and Month DATA what is I disliked.

Thinking an example :
Present data is already there DEC/2022 & JAN/2023 in table "tblPayrollData"

Now I working on FEB/2023 in table "tblPayrollData".
Next Month I work on MAR/2023. If I trying to run append query, It is should take data records from FEB/2023. Because FEB/2023 is my latest update data in table "tblPayrollData".

But unfortunately, its taken data from DEC/2022.
Hope you understand...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 05:48
Joined
May 7, 2009
Messages
19,249
can you post your "tblPayrollData" table?
 

smtazulislam

Member
Local time
, 00:48
Joined
Mar 27, 2020
Messages
806
Sorry for late response. Ramadhan Kareem to all.
I uploaded db with "tblPayrollData" table.

I need latest records is taken next appending. Now there have 33 records available. When I tried to appending NEW record that is taken FIRST 33 records. Not token latest records.
 

Attachments

  • Payroll New Ver 2 (2) (2).accdb
    1.4 MB · Views: 58

arnelgp

..forever waiting... waiting for jellybean!
Local time
, 05:48
Joined
May 7, 2009
Messages
19,249
i worked on frmCreateAppend form.
i made 3 queries (qryLatestPayMonthYear, qryDataToAppend and qryAppendData)
you test it now.
 

Attachments

  • Payroll New Ver 2 (2) (2).accdb
    1.1 MB · Views: 74

Users who are viewing this thread

Top Bottom