Jumat, 15 November 2019

Re: [MS_AccessPros] Re: The Update query issue

 

You will probably have to ask the user to uninstall the KB. Otherwise you will have to do a ton of temporary rewriting of your queries.

Regards,
Bill Mosca

------ Original message------
From: Jim Wagner luvmymelody@yahoo.com [MS_Access_Professionals]
Date: Fri, Nov 15, 2019 12:49 PM
Cc:
Subject:Re: [MS_AccessPros] Re: The Update query issue

 

The user has the KB installed. I will try the step into

Jim Wagner


On Friday, November 15, 2019, 1:45:28 PM MST, wrmosca@comcast.net [MS_Access_Professionals] > wrote:


 

Oops! I found your closing paren. Follow Duane's advice. But find out if the user has the bad Office Update KB installed (see earlier posting).-Bill


---In MS_Access_Professionals@yahoogroups.com, > wrote :

Jim - I see a wayward parenthesis right before DateDiff. Either remove it or put a closing paren after ProcessEventEndDt = False
If (DateDiff("d", EventEndDt, currDate) > 0) And ProcessedInv = True And ProcessEventEndDt = False Then

-Bill

---In MS_Access_Professionals@yahoogroups.com, > wrote :

Hello all,


I am having issues with a line of code for the UPDATE statement. I have created a query and then created the update query and pasted the sql statement into the line of code and modified it to be relevant and it is still not working. can someone give me some direction please. It is a mission critical database and the user is calling my boss and complaining



Thank You


Jim Wagner


here is the code. it is crashing on the


Do While Not rs2.EOF
    Id = rs2!EventID
    ProcessedInv = rs2!ProcessedInv
    ProcessEventEndDt = rs2!ProcessEventEndDt
    EventEndDt = rs2!EventEndDt
   ' MsgBox "INner Loop" & EventEndDt & currDate & Id, vbInformation
   'if the event is over but the inventory is not put back, the loop in run
    If (DateDiff("d", EventEndDt, currDate) > 0) And ProcessedInv = True And ProcessEventEndDt = False Then
   
       ' MsgBox "INnermost Loop" & EventEndDt & currDate & Id, vbInformation
        cntr = 0
        Set RS = Form_frmMainEvents.SubformEventDetails.Form.Recordset
        RS.MoveFirst
        Do While Not RS.EOF
       '  MsgBox "INnermost Loop" & EventEndDt & currDate & Id, vbInformation
            Q1 = Form_frmMainEvents![SubformEventDetails].Form![quantity]
            colName1 = Form_frmMainEvents![SubformEventDetails].Form![Item_Name]
            Lcntr = DateDiff("d", rs2!DeliveryDt, rs2!EventEndDt) + 1
            For cntr = 0 To Lcntr - 1
                invDate = DateAdd("d", cntr, rs2!DeliveryDt)
                CurrentDb.Execute " Update Tbl_InvDetails set [" & colName1 & "] = [" & colName1 & "] + " & Q1 & " where Tbl_InvDetails.InvDate = #" & invDate & "#  ", dbFailOnError
            Next
            RS.MoveNext
        Loop

__._,_.___

Posted by: wrmosca <wrmosca@comcast.net>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

.

__,_._,___

Tidak ada komentar:

Posting Komentar