Rabu, 28 Juni 2023

Re: [MSAccessProfessionals] Combine several update queries into one query

Ok, the simple short answer is that the first query CANNOT be combined with either of the others.
However, the 2nd query [qry_UpdateCOMPAccural] and 3rd query MIGHT be able to be combined...but it depends on when/how they are used. So, in short, it's a timing-sensitive operation.
 
The first query definitely updates a different set of records than the other two.
the 2nd and 3rd queries, on the surface, seem to update the same set of records on the same table joins. So that makes them a candidate to be combined. but, if these queries have served you well for over 10+ years, I would not mess with them unless there was a DANGED GOOD reason to do so, and "reducing the number of queries to maintain" is not necessarily a sufficiently good reason to do so by itself.
 
I would leave well enough alone in this case.
 
- Mark
On 06/28/2023 6:58 PM EDT Jim Wagner <josephwagner2@outlook.com> wrote:
 
 
Mark,
Though this is not a big issue. I have dealt with this for 17 years, so if it cannot be done, i will live. I just was looking at any way of being more efficient. We are finally after 17 years moving to SQL after me pleading and begging and teaching that how we do things is not industry standard. We are still using Access as the front end because it would take another 17 years to redo every database in another UI.


qry_UpdateSICKAccrual

UPDATE [qry_R&D-ACCRUALS] INNER JOIN qry_AccrualsForReport ON [qry_R&D-ACCRUALS].Emplid = qry_AccrualsForReport.Emplid SET qry_AccrualsForReport.sick = [Balance], qry_AccrualsForReport.YTDsick = [Hrs Taken Ytd]
WHERE ((([qry_R&D-ACCRUALS].[Plan Type Descr])="Sick"));


qry_UpdateVACAccrual
UPDATE [qry_R&D-ACCRUALS] INNER JOIN qry_AccrualsForReport ON ([qry_R&D-ACCRUALS].Emplid = qry_AccrualsForReport.Emplid) AND ([qry_R&D-ACCRUALS].[Accrual Proc Dt] = qry_AccrualsForReport.[Accrual Proc Dt]) SET qry_AccrualsForReport.vac = [Balance], qry_AccrualsForReport.YTDvac = [Hrs Taken Ytd]
WHERE ((([qry_R&D-ACCRUALS].[Plan Type Descr])="Vacation"));


qry_UpdateCOMPAccural
UPDATE [qry_R&D-ACCRUALS] INNER JOIN qry_AccrualsForReport ON ([qry_R&D-ACCRUALS].Emplid = qry_AccrualsForReport.Emplid) AND ([qry_R&D-ACCRUALS].[Accrual Proc Dt] = qry_AccrualsForReport.[Accrual Proc Dt]) SET qry_AccrualsForReport.vac = [Balance], qry_AccrualsForReport.YTDvac = [Hrs Taken Ytd]
WHERE ((([qry_R&D-ACCRUALS].[Plan Type Descr])="Vacation"));



Re: [MSAccessProfessionals] Combine several update queries into one query

Mark,
Though this is not a big issue. I have dealt with this for 17 years, so if it cannot be done, i will live. I just was looking at any way of being more efficient. We are finally after 17 years moving to SQL after me pleading and begging and teaching that how we do things is not industry standard. We are still using Access as the front end because it would take another 17 years to redo every database in another UI.


qry_UpdateSICKAccrual

UPDATE [qry_R&D-ACCRUALS] INNER JOIN qry_AccrualsForReport ON [qry_R&D-ACCRUALS].Emplid = qry_AccrualsForReport.Emplid SET qry_AccrualsForReport.sick = [Balance], qry_AccrualsForReport.YTDsick = [Hrs Taken Ytd]
WHERE ((([qry_R&D-ACCRUALS].[Plan Type Descr])="Sick"));


qry_UpdateVACAccrual
UPDATE [qry_R&D-ACCRUALS] INNER JOIN qry_AccrualsForReport ON ([qry_R&D-ACCRUALS].Emplid = qry_AccrualsForReport.Emplid) AND ([qry_R&D-ACCRUALS].[Accrual Proc Dt] = qry_AccrualsForReport.[Accrual Proc Dt]) SET qry_AccrualsForReport.vac = [Balance], qry_AccrualsForReport.YTDvac = [Hrs Taken Ytd]
WHERE ((([qry_R&D-ACCRUALS].[Plan Type Descr])="Vacation"));


qry_UpdateCOMPAccural
UPDATE [qry_R&D-ACCRUALS] INNER JOIN qry_AccrualsForReport ON ([qry_R&D-ACCRUALS].Emplid = qry_AccrualsForReport.Emplid) AND ([qry_R&D-ACCRUALS].[Accrual Proc Dt] = qry_AccrualsForReport.[Accrual Proc Dt]) SET qry_AccrualsForReport.vac = [Balance], qry_AccrualsForReport.YTDvac = [Hrs Taken Ytd]
WHERE ((([qry_R&D-ACCRUALS].[Plan Type Descr])="Vacation"));



Re: [MSAccessProfessionals] Combine several update queries into one query

Jim,
 
Before I could answer that:
1) can we see that actual SQL for the queries
2) If you can give us a representative look at the data in the tables, that would help us greatly to determine if the queries can be engineered more succinctly/efficiently.
 
While in strict SQL terms it may be possible to combine operations, in SET Theory (mathematical) terms, it may or may not be "safe" to undertake such operations.
 
in short, we need some more information before we can reasonably answer you.
 
- Mark Burns
Owner, Professional Microsoft Access Developers Network [PMADN] Group, LinkedIn.com
 
On 06/28/2023 3:54 PM EDT Jim Wagner <josephwagner2@outlook.com> wrote:
 
 
Hello all,
I am looking at a very old process that creates a table daily. My retired boss created it a very long time ago, so I wanted to know if there is a way of making the process more efficient. I am breaking down the multiple queries in sections to see if i can recreate the process in less queries.
There are 3 update queries that update a table with values based on some criteria. there are 2 sources that are joined together to be the source. Below is the
The 3 queries update columns such as sick, vacation and comp with the balance for each. below are the query summary
sick column and Hrs taken Ytd for the YTDsick column based on the criteria of "Sick" for the Plan Type Descr field.
vac column and Hrs taken Ytd for the YTDsick column based on the criteria of "Vacation" for the Plan Type Descr field.
comp column and Hrs taken Ytd for the YTDsick column based on the criteria of "Comp time" for the Plan Type Descr field and "5W" for the Plan Type field.

Is there a way of getting this to be one query or I am I where I am at for good?

Thank You

Jim Wagner

[MSAccessProfessionals] Combine several update queries into one query

Hello all,
I am looking at a very old process that creates a table daily. My retired boss created it a very long time ago, so I wanted to know if there is a way of making the process more efficient. I am breaking down the multiple queries in sections to see if i can recreate the process in less queries.
There are 3 update queries that update a table with values based on some criteria. there are 2 sources that are joined together to be the source. Below is the
The 3 queries update columns such as sick, vacation and comp with the balance for each. below are the query summary
sick column and Hrs taken Ytd for the YTDsick column based on the criteria of "Sick" for the Plan Type Descr field.
vac column and Hrs taken Ytd for the YTDsick column based on the criteria of "Vacation" for the Plan Type Descr field.
comp column and Hrs taken Ytd for the YTDsick column based on the criteria of "Comp time" for the Plan Type Descr field and "5W" for the Plan Type field.

Is there a way of getting this to be one query or I am I where I am at for good?

Thank You

Jim Wagner
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116397) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Sabtu, 24 Juni 2023

Re: [MSAccessProfessionals] DLookup not working

DLookup() in a query is very inefficient.  Generally speaking you'd join the tables, like: 

SELECT Tbl_COTag.[COLOR OUT1:], Tbl_HBColor.ColourName, Tbl_HBColor.FrenchTranslation
FROM Tbl_COTag INNER JOIN Tbl_HBColor ON Tbl_COTag.[COLOR OUT1:] = Tbl_HBColor.ColourName;

In the rare event that you needed a DLookup() it would look like:

DLookUp("ColourName","tbl_HBColor","ColourName = '" & [COLOR OUT1:] & "'")

Paul


------ Original Message ------
Sent: 6/24/2023 3:45:45 AM
Subject: Re: [MSAccessProfessionals] DLookup not working

Dear Sir,
Please find the attached my simple Access Database "TestData" where contained 2 Tables "Tbl_COTag" and "Tbl_HBColor" , actually "Tbl_HBColor" Table carried 2 fields "ColourName" and "FrenchTranslation" . And Table "Tbl_COTag" where field "COLOR OUT1:" stored value should be LOOKUP value from source Table "Tbl_HBColor" in field "ColurName" and "FrenchTranslation" to table "Tbl_COTag" in field "Lookup_HB_ENG_C" and "Lookup_HB_ENG_F"

Actually I need same as excel VLOOKUP function working process in Access Database using DLOOKUP function, for example I've attached both Access "TestData" and Excel  "VLOOKUP_Excel" file for your better understanding.

If you give me clear Query example using DLOOKUP function in my attached "TestData" Access Database then it will best for me.

Thanks
Porag

Re: [MSAccessProfessionals] DLookup not working

Dear Sir,
Please find the attached my simple Access Database "TestData" where contained 2 Tables "Tbl_COTag" and "Tbl_HBColor" , actually "Tbl_HBColor" Table carried 2 fields "ColourName" and "FrenchTranslation" . And Table "Tbl_COTag" where field "COLOR OUT1:" stored value should be LOOKUP value from source Table "Tbl_HBColor" in field "ColurName" and "FrenchTranslation" to table "Tbl_COTag" in field "Lookup_HB_ENG_C" and "Lookup_HB_ENG_F"

Actually I need same as excel VLOOKUP function working process in Access Database using DLOOKUP function, for example I've attached both Access "TestData" and Excel  "VLOOKUP_Excel" file for your better understanding.

If you give me clear Query example using DLOOKUP function in my attached "TestData" Access Database then it will best for me.

Thanks
Porag
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116395) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Jumat, 23 Juni 2023

Re: [MSAccessProfessionals] Filter report before emailing it

Hello Doyce,
I have to do this as well.  A solution that I found that works is to use a table to store the ID of the supervisor.  Then create the report and query to filter off of that value in the table.  Then as you loop, you can update that value with the current supervisor and export the report.

Mike D
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116394) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Kamis, 22 Juni 2023

Re: [MSAccessProfessionals] Filter report before emailing it

I would try use some DAO code to modify the SQL property of a saved query in the record source of the report. This allows you to temporarily use a query filtered by supervisor.

Duane

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Doyce Winberry <doyce.winberry@xpo.com>
Sent: Thursday, June 22, 2023 3:59 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: [MSAccessProfessionals] Filter report before emailing it
 

Hello everyone,

 

I have an attendance list report that I would like to filter by supervisor and email each supervisor only their pages of the report. I have sub procedure, "SendMailAttachment", that will email the report. It's variables are the report name and recipients. I have setup this VBA code that will loop through the supervisors and pull out their email address. I can also filter the report and print it by supervisor. I just don't know how to filter the report and then email the filtered report to each supervisor. Here is the code:

Public Sub AttendanceList()

    'Email Attendance list to each supervisor

    Dim db As Database

    Dim rst As DAO.Recordset

    Dim lngSupID As Long

    Dim SupEmail As String

      

        Set db = CurrentDb

        Set rst = db.OpenRecordset("tblSupervisorEmail")

        Do Until rst.EOF

            lngSupID = rst![EEID-1]

            SupEmail = rst![Email]

            SendMailAttachment "rptAttendanceSheet-Email", SupEmail

            DoCmd.OpenReport "rptAttendanceSheet-Email", acViewNormal, , "SupID = " & lngSupID

            Debug.Print rst![Email]

            rst.MoveNext

        Loop

        rst.Close

        Set rst = Nothing

        Set db = Nothing

       

End Sub

 

This line will email the complete report to each supervisor   SendMailAttachment "rptAttendanceSheet-Email", SupEmail

This line filters the report and will print each supervisor's report separately, DoCmd.OpenReport "rptAttendanceSheet-Email", acViewNormal, , "SupID = " & lngSupID

 

I need to know how to add the filter to the sendMailAttachment sub procedure.

 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

Re: [MSAccessProfessionals] Sharepoint and MS Excel Import into MS Access

Short answer: You Cant. Reading: Ms Accesa hasnt been updated to cater for SharePoint active directory based security.


On Friday, June 23, 2023, <kensaffer@gmail.com> wrote:
How do you import an Excel file that is on sharepoint into MS Access? Seems like the path is not simple.

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116392) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

[MSAccessProfessionals] Filter report before emailing it

Hello everyone,

 

I have an attendance list report that I would like to filter by supervisor and email each supervisor only their pages of the report. I have sub procedure, “SendMailAttachment”, that will email the report. It’s variables are the report name and recipients. I have setup this VBA code that will loop through the supervisors and pull out their email address. I can also filter the report and print it by supervisor. I just don’t know how to filter the report and then email the filtered report to each supervisor. Here is the code:

Public Sub AttendanceList()

    'Email Attendance list to each supervisor

    Dim db As Database

    Dim rst As DAO.Recordset

    Dim lngSupID As Long

    Dim SupEmail As String

      

        Set db = CurrentDb

        Set rst = db.OpenRecordset("tblSupervisorEmail")

        Do Until rst.EOF

            lngSupID = rst![EEID-1]

            SupEmail = rst![Email]

            SendMailAttachment "rptAttendanceSheet-Email", SupEmail

            DoCmd.OpenReport "rptAttendanceSheet-Email", acViewNormal, , "SupID = " & lngSupID

            Debug.Print rst![Email]

            rst.MoveNext

        Loop

        rst.Close

        Set rst = Nothing

        Set db = Nothing

       

End Sub

 

This line will email the complete report to each supervisor   SendMailAttachment "rptAttendanceSheet-Email", SupEmail

This line filters the report and will print each supervisor’s report separately, DoCmd.OpenReport "rptAttendanceSheet-Email", acViewNormal, , "SupID = " & lngSupID

 

I need to know how to add the filter to the sendMailAttachment sub procedure.

 

 

Doyce Winberry

Manufacturing

Manager Systems

 

XPO

2001 Benton Street

Searcy, AR 72143 USA

O: +1 501-207-5973   M: +1 501-207-2269

 

[MSAccessProfessionals] Sharepoint and MS Excel Import into MS Access

How do you import an Excel file that is on sharepoint into MS Access? Seems like the path is not simple.
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116390) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Re: [MSAccessProfessionals] DLookup not working

Porag,
It isn't clear to me what criteria you would use to filter Tbl_HBColor based on a value from Tbl_COTag and field from Tbl-HBColor.

UPDATE Tbl_COTag SET HB_Eng_Col = DLookup("ColourName","Tbl_HBColor","???")

Again, please include enough of the previous posts in your reply so that I don't have to scan through previous emails.

Duane

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of porag379@gmail.com <porag379@gmail.com>
Sent: Wednesday, June 21, 2023 1:59 PM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] DLookup not working
 
Dear Sir,

For your kind information, My requirement is from table "Tbl_HBColor", Field "ColourName" Text Data will populate  to Table "Tbl_COTag", in field "HB_Eng_Col" where lookup search value Table "Tbl_COTag" in field "COLOR" and entire this process will execute by update query. 

Thanks, 
Porag

Rabu, 21 Juni 2023

Re: [MSAccessProfessionals] DLookup not working

Dear Sir,

For your kind information, My requirement is from table "Tbl_HBColor", Field "ColourName" Text Data will populate  to Table ”Tbl_COTag", in field "HB_Eng_Col" where lookup search value Table "Tbl_COTag" in field "COLOR" and entire this process will execute by update query. 

Thanks, 
Porag
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116388) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Re: [MSAccessProfessionals] DLookup not working

You would not want Tbl_HBColor in the query since it only needs to be referenced in the DLookup(). Also, the "domain" of the DLookup() is Tbl_HBColor but it doesn't contain the field "Color".

Could you describe your requirements in words? Also, when replying please include the previous thread so we have more context and don't have to search through deleted emails to find your original post and others.

Duane

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of porag379@gmail.com <porag379@gmail.com>
Sent: Wednesday, June 21, 2023 6:12 AM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] DLookup not working
 
Dear Sir,

Please see the below Snap and attached simple Database TestDB , where Tbl_COTag Table "COLOR" field value Lookup "ColourName" Field value from Table "Tbl_HBColor" and Lookup String (ShortText) value populate in field "Hb_Eng_Col" on Table "Tbl_COTag"  . Could you advise where I was mistaken ? Dlookup Not working on my TestDB which attached for your better understanding, your help and advise highly expecting.

Note : All are ShortText data

Re: [MSAccessProfessionals] DLookup not working

Dear Sir,

Please see the below Snap and attached simple Database TestDB , where Tbl_COTag Table "COLOR" field value Lookup "ColourName" Field value from Table "Tbl_HBColor" and Lookup String (ShortText) value populate in field "Hb_Eng_Col" on Table "Tbl_COTag"  . Could you advise where I was mistaken ? Dlookup Not working on my TestDB which attached for your better understanding, your help and advise highly expecting.

Note : All are ShortText data

Re: [MSAccessProfessionals] DLookup not working

you can also create a function to Pick the correct color (see fnColor1 on Module1) and call the function on your
Update query (see Query2).

On Wed, Jun 21, 2023 at 4:27 AM Duane Hookom <duanehookom@hotmail.com> wrote:
I'm not sure if any file came through since I'm using my cell phone. 

You mention a query and DLookup but didn't provide the SQL view and data types of significant fields. This would be the minimum information required to get an accurate response. 

Duane

Sent from my mobile

On Jun 20, 2023, at 2:56 PM, porag379@gmail.com wrote:

Sir, Good evening. This is porag and I'm Microsoft Access learner. I want to use DLOOKUP in Access Table for pull data from difference Table but can't it. Could you help me?  Attached my Simple access database where I've created a update query with Dlookup function but not working. Could you point out my mistake?

Thanks
Porag
<TestData.accdb>



--
Arnelito G. Puzon


_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116386) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Selasa, 20 Juni 2023

Re: [MSAccessProfessionals] DLookup not working

I'm not sure if any file came through since I'm using my cell phone. 

You mention a query and DLookup but didn't provide the SQL view and data types of significant fields. This would be the minimum information required to get an accurate response. 

Duane

Sent from my mobile

On Jun 20, 2023, at 2:56 PM, porag379@gmail.com wrote:

Sir, Good evening. This is porag and I'm Microsoft Access learner. I want to use DLOOKUP in Access Table for pull data from difference Table but can't it. Could you help me?  Attached my Simple access database where I've created a update query with Dlookup function but not working. Could you point out my mistake?

Thanks
Porag
<TestData.accdb>

Re: [MSAccessProfessionals] DLookup not working

myNewData=lookup("myField","myTable",myvar & "= MyFieldName")
This will look in the table, myTable for a field named myField, where the MyFieldName = the value of myvar.



On Tue, Jun 20, 2023 at 3:56 PM, porag379@gmail.com
<porag379@gmail.com> wrote:
Sir, Good evening. This is porag and I'm Microsoft Access learner. I want to use DLOOKUP in Access Table for pull data from difference Table but can't it. Could you help me?  Attached my Simple access database where I've created a update query with Dlookup function but not working. Could you point out my mistake?

Thanks
Porag
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116383) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

[MSAccessProfessionals] DLookup not working

Sir, Good evening. This is porag and I'm Microsoft Access learner. I want to use DLOOKUP in Access Table for pull data from difference Table but can't it. Could you help me?  Attached my Simple access database where I've created a update query with Dlookup function but not working. Could you point out my mistake?

Thanks
Porag
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116382) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Jumat, 02 Juni 2023

Re: [MSAccessProfessionals] VBA Export to excel issue

Thank You so much for your responses. 
My thought was to kill the existing file in the folder and then have the process replace it. But I decided to try another way according to the users requests. 

Thank You

Jim Wagner

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Paul Baldy <Pbaldy@gmail.com>
Sent: Thursday, June 1, 2023 9:12 AM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] VBA Export to excel issue
 
>> I know that exporting to an existing excel does not overwrite it adds the new sheet. 

Not in my experience, at least not with OutputTo.  

Paul

------ Original Message ------
From: "Cheeseburger" <Michael.P.Devlin@hofstra.edu>
Sent: 6/1/2023 6:54:15 AM
Subject: Re: [MSAccessProfessionals] VBA Export to excel issue

When you say killpath,are you killing the file first?  I know that exporting to an existing excel does not overwrite it adds the new sheet. 

Kamis, 01 Juni 2023

Re: [MSAccessProfessionals] VBA Export to excel issue

>> I know that exporting to an existing excel does not overwrite it adds the new sheet. 

Not in my experience, at least not with OutputTo.  

Paul

------ Original Message ------
From: "Cheeseburger" <Michael.P.Devlin@hofstra.edu>
Sent: 6/1/2023 6:54:15 AM
Subject: Re: [MSAccessProfessionals] VBA Export to excel issue

When you say killpath,are you killing the file first?  I know that exporting to an existing excel does not overwrite it adds the new sheet. 

Re: [MSAccessProfessionals] VBA Export to excel issue

When you say killpath,are you killing the file first?  I know that exporting to an existing excel does not overwrite it adds the new sheet.