PC Review


Reply
Thread Tools Rate Thread

docmd. run sql syntax error for update query.

 
 
usaccess@gmail.com
Guest
Posts: n/a
 
      7th Sep 2006
All,

Can you please let me know what I am doing wrong. I am getting an error
24 object required.

Also do I need to do a refresh or a requery to stay in the same
location.

thanks for your help.

us.

DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
[ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
tbldeliverableTrackingAlt.CaseRecordNumber = " &
CLng(Me.CaseRecordNumber) And tbldeliverabletrackingalt.Sort =
CLng(Me.Sort)

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      7th Sep 2006
DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
[ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
tbldeliverableTrackingAlt.CaseRecordNumber = " &
CLng(Me.CaseRecordNumber) & " And tbldeliverabletrackingalt.Sort = " &
CLng(Me.Sort)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> All,
>
> Can you please let me know what I am doing wrong. I am getting an error
> 24 object required.
>
> Also do I need to do a refresh or a requery to stay in the same
> location.
>
> thanks for your help.
>
> us.
>
> DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
> [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
> tbldeliverableTrackingAlt.CaseRecordNumber = " &
> CLng(Me.CaseRecordNumber) And tbldeliverabletrackingalt.Sort =
> CLng(Me.Sort)
>



 
Reply With Quote
 
usaccess@gmail.com
Guest
Posts: n/a
 
      7th Sep 2006
Doug,

Thanks for your help. The object error went but now I am getting a
error message cannot update database, conversion error, and validation
run violations.

Would greatly appreciate any suggestions.

US



Douglas J. Steele wrote:
> DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
> [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
> tbldeliverableTrackingAlt.CaseRecordNumber = " &
> CLng(Me.CaseRecordNumber) & " And tbldeliverabletrackingalt.Sort = " &
> CLng(Me.Sort)
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > All,
> >
> > Can you please let me know what I am doing wrong. I am getting an error
> > 24 object required.
> >
> > Also do I need to do a refresh or a requery to stay in the same
> > location.
> >
> > thanks for your help.
> >
> > us.
> >
> > DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
> > [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
> > tbldeliverableTrackingAlt.CaseRecordNumber = " &
> > CLng(Me.CaseRecordNumber) And tbldeliverabletrackingalt.Sort =
> > CLng(Me.Sort)
> >


 
Reply With Quote
 
usaccess@gmail.com
Guest
Posts: n/a
 
      7th Sep 2006
Finally figured out the problem. I had it as an after update event,
when I changed it to an after exit even, there were no record locks and
the logic worked.

thanks

(E-Mail Removed) wrote:
> Doug,
>
> Thanks for your help. The object error went but now I am getting a
> error message cannot update database, conversion error, and validation
> run violations.
>
> Would greatly appreciate any suggestions.
>
> US
>
>
>
> Douglas J. Steele wrote:
> > DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
> > [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
> > tbldeliverableTrackingAlt.CaseRecordNumber = " &
> > CLng(Me.CaseRecordNumber) & " And tbldeliverabletrackingalt.Sort = " &
> > CLng(Me.Sort)
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no e-mails, please!)
> >
> >
> > <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > All,
> > >
> > > Can you please let me know what I am doing wrong. I am getting an error
> > > 24 object required.
> > >
> > > Also do I need to do a refresh or a requery to stay in the same
> > > location.
> > >
> > > thanks for your help.
> > >
> > > us.
> > >
> > > DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
> > > [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
> > > tbldeliverableTrackingAlt.CaseRecordNumber = " &
> > > CLng(Me.CaseRecordNumber) And tbldeliverabletrackingalt.Sort =
> > > CLng(Me.Sort)
> > >


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      7th Sep 2006
Sort's likely a reserved word. If you cannot (or will not) rename the field,
at least put square brackets around it:

DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
[ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
tbldeliverableTrackingAlt.CaseRecordNumber = " &
CLng(Me.CaseRecordNumber) & " And tbldeliverabletrackingalt.[Sort] = " &
CLng(Me.Sort)

If that doesn't solve it, are both CaseRecordNumber and Sort numeric fields?
(That's what your SQL implies). If, for example, CaseRecordNumber happens to
be text, you'll need to put quotes around the value:

DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
[ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
tbldeliverableTrackingAlt.CaseRecordNumber = " & Chr$(34) &
CLng(Me.CaseRecordNumber) & Chr$(34) & " And
tbldeliverabletrackingalt.[Sort] = " & CLng(Me.Sort)


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Doug,
>
> Thanks for your help. The object error went but now I am getting a
> error message cannot update database, conversion error, and validation
> run violations.
>
> Would greatly appreciate any suggestions.
>
> US
>
>
>
> Douglas J. Steele wrote:
>> DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
>> [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
>> tbldeliverableTrackingAlt.CaseRecordNumber = " &
>> CLng(Me.CaseRecordNumber) & " And tbldeliverabletrackingalt.Sort = " &
>> CLng(Me.Sort)
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > All,
>> >
>> > Can you please let me know what I am doing wrong. I am getting an error
>> > 24 object required.
>> >
>> > Also do I need to do a refresh or a requery to stay in the same
>> > location.
>> >
>> > thanks for your help.
>> >
>> > us.
>> >
>> > DoCmd.RunSQL "UPDATE tblDeliverableTrackingAlt SET
>> > [ActCompDate]=Date(),[EstHourstoComplete]= 0 WHERE
>> > tbldeliverableTrackingAlt.CaseRecordNumber = " &
>> > CLng(Me.CaseRecordNumber) And tbldeliverabletrackingalt.Sort =
>> > CLng(Me.Sort)
>> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error in update query Jean-Paul Microsoft Access Queries 4 19th Jan 2009 11:03 PM
Update Query Syntax Error Shytown_Turk Microsoft Access Queries 4 11th Dec 2007 04:42 PM
syntax error in multiple update query =?Utf-8?B?WmFoZWVy?= Microsoft Access 4 18th Sep 2007 06:29 AM
update query that has a syntax error when run =?Utf-8?B?RWR3YXJkIExldGVuZHJl?= Microsoft Access Queries 1 26th Apr 2006 03:05 AM
syntax error in update query maxhodges Microsoft Access Queries 1 17th Nov 2003 05:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 PM.