A
Associates
Hi,
I was wondering if i could get some help with the query i am having trouble
with. I was trying to update some data in a table called "Students". So below
is my update query.
Set WorkBase = CurrentDb
Updatequery = "UPDATE [Invoices]"
Updatequery = Updatequery & " SET myCurrentInvoice2 = 0,
RemainingInvoice2 = 0"
Updatequery = Updatequery & " WHERE Project_No like '" &
Me.LB_JobList.Column(0) & "'"
WorkBase.Execute Updatequery, dbFailOnError
WorkBase.Close
I know that with the above query, it will update every records whose Project
No is the same as that of Column(0).
However, there is one thing i want it to do. I want it to update one field
(say, PreviousInvoice) as the query is being executed and the value of
PreviousInvoice is the same as PreviousInvoice2 whose value has already been
determined. So I was trying to copy from the value of PreviousInvoice2 to
PreviousInvoice. I modified the code as below
Updatequery = "UPDATE [Invoices]"
Updatequery = Updatequery & " SET myCurrentInvoice2 = 0,
RemainingInvoice2 = 0, PreviousInvoice =" & PreviousInvoice2
Updatequery = Updatequery & " WHERE Project_No like '" &
Me.LB_JobList.Column(0) & "'"
I got error on this as i expected. How do i get around this?
PreviousInvoice2 and PreviousInvoice are both part of "Invoices" table
fields. Therefore, PreviousInvoice2 is not a variable that user enters in.
Any helps would be greatly appreciated
I was wondering if i could get some help with the query i am having trouble
with. I was trying to update some data in a table called "Students". So below
is my update query.
Set WorkBase = CurrentDb
Updatequery = "UPDATE [Invoices]"
Updatequery = Updatequery & " SET myCurrentInvoice2 = 0,
RemainingInvoice2 = 0"
Updatequery = Updatequery & " WHERE Project_No like '" &
Me.LB_JobList.Column(0) & "'"
WorkBase.Execute Updatequery, dbFailOnError
WorkBase.Close
I know that with the above query, it will update every records whose Project
No is the same as that of Column(0).
However, there is one thing i want it to do. I want it to update one field
(say, PreviousInvoice) as the query is being executed and the value of
PreviousInvoice is the same as PreviousInvoice2 whose value has already been
determined. So I was trying to copy from the value of PreviousInvoice2 to
PreviousInvoice. I modified the code as below
Updatequery = "UPDATE [Invoices]"
Updatequery = Updatequery & " SET myCurrentInvoice2 = 0,
RemainingInvoice2 = 0, PreviousInvoice =" & PreviousInvoice2
Updatequery = Updatequery & " WHERE Project_No like '" &
Me.LB_JobList.Column(0) & "'"
I got error on this as i expected. How do i get around this?
PreviousInvoice2 and PreviousInvoice are both part of "Invoices" table
fields. Therefore, PreviousInvoice2 is not a variable that user enters in.
Any helps would be greatly appreciated