Solved

Runtime Error 3188

Posted on 2004-10-05
7
260 Views
Last Modified: 2009-07-13
I have a form based on a query which displays data relating to a work log, one of the fields is a comments memo field.
The user can add comments using another unbound form that updates the comments field via an SQL statement.
Every time I run the SQL I get the runtime error 3188. Any Ideas ?

I have just noticed that if my form is not filtered in any way the sql statement works fine, problem only happens when a value is entered (log no) in a filter field on the form, the after update event requery's the query to display only the records that satify the log number.

0
Comment
Question by:Duggie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 6

Expert Comment

by:snavebelac
ID: 12226224
Could you post the code used to generate your sql stetament or the sql statement itself.

C
0
 

Author Comment

by:Duggie
ID: 12226406
sql = "UPDATE ticket_tbl SET ticket_tbl.comments = """ & comments & """ WHERE ticket_tbl.ticketid = Forms![comments_frm]![text4]"
DoCmd.RunSQL sql
0
 
LVL 6

Expert Comment

by:snavebelac
ID: 12226597
Try this . ..

DoCmd.RunSQL "UPDATE ticket_tbl SET ticket_tbl.comments = '" & comments & "' WHERE ticket_tbl.ticketid = " & Forms![comments_frm]![text4]

C
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Duggie
ID: 12226771
Generates a syntax error 3075, the comments variable can be a very long string that is generated from a txt file using
Set objstream = objFSO.opentextfile("c:\temp\comments.txt")
comments = objstream.Readall
thats the reason I used the """ quotes to force it to read as a string.
I know the sql statement works I just can't suss out why it thinks the table is locked.
The query the form is based on looks at 4 tables request_tbl, ticket_tbl, stage_tbl & priority_tbl resulting in a query called veiwreq_qry.
The code updates 3 different fields in 2 different tables.
sql = "UPDATE request_tbl SET request_tbl.amended=#" & Now() & "# where request_tbl.ticket_no = Forms![comments_frm]![text4]"
DoCmd.RunSQL sql
sql = "UPDATE ticket_tbl SET ticket_tbl.comments = """ & comments & """ WHERE ticket_tbl.ticketid = Forms![comments_frm]![text4]"
DoCmd.RunSQL sql
sql = "UPDATE ticket_tbl SET ticket_tbl.datemodified=#" & Now() & "# where ticket_tbl.ticketid = Forms![comments_frm]![text4]"
DoCmd.RunSQL sql
But only breaks down on the 2nd SQL query, ie the update to the request_tbl.amended field works fine.
relationship between request_tbl and ticket_tbl is one to many.

0
 

Author Comment

by:Duggie
ID: 12227027
Think I have solved it code now reads as follows

Forms![viewreq_frm].RecordSource = ""
sql = "UPDATE ticket_tbl SET ticket_tbl.comments = """ & comments & """ WHERE ticket_tbl.ticketid = Forms![comments_frm]![text4]"
DoCmd.RunSQL sql
sql = "UPDATE ticket_tbl SET ticket_tbl.datemodified=#" & Now() & "# where ticket_tbl.ticketid = Forms![comments_frm]![text4]"
DoCmd.RunSQL sql
Forms![viewreq_frm].RecordSource = "request_qry"

Removed the recordsource from the form, updated the ticket_tbl.comments box and than replaced the recordsource on the table, sure there will be a better way but this seems to work.

But thanks for your efforts C

Regards
Duggie

0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12267792
Question answered by asker or dialog valuable.
Closed, 125 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CISCO WIFI 6 73
Outlook Automation in Access Using "Find" 2 59
Queries: Select, then Append, then Delete 8 41
Access Report via Windows Desktop Shortcut 12 42
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question