Run time error 3077

I am getting a run time error 3077 whenever I select a record from the 
combobox with an apostophe as part of the text in the combo box.  Can anyone 
tell me what the apostrophes do in the code below and if there is a good 
error handling feature to prevent this so I can have company names with 
apostrphes in the combo box without getting the run time error?  Listed below 
is the code:   


Private Sub CboCompanyLookup_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Client Name] = '" & Me![CboCompanyLookup] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Thanks,

Terry Carroll

0
Utf
3/25/2010 6:23:01 PM
access 16762 articles. 3 followers. Follow

1 Replies
1247 Views

Similar Articles

[PageSpeed] 17

On Thu, 25 Mar 2010 11:23:01 -0700, Terrence Carroll
<TerrenceCarroll@discussions.microsoft.com> wrote:

>I am getting a run time error 3077 whenever I select a record from the 
>combobox with an apostophe as part of the text in the combo box.  Can anyone 
>tell me what the apostrophes do in the code below and if there is a good 
>error handling feature to prevent this so I can have company names with 
>apostrphes in the combo box without getting the run time error?  Listed below 
>is the code:   
>
>
>Private Sub CboCompanyLookup_AfterUpdate()
>    ' Find the record that matches the control.
>    Dim rs As Object
>
>    Set rs = Me.Recordset.Clone
>    rs.FindFirst "[Client Name] = '" & Me![CboCompanyLookup] & "'"
>    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
>End Sub
>
>Thanks,
>
>Terry Carroll

The problem is that the apostrophe is being seen as the closing quote in the
string. There are two solutions - replace the ' with two consecutive '
characters, or (probably more simply) use " as the delimiter. For the first
option use

    rs.FindFirst "[Client Name] = '" _
          & Replace(Me![CboCompanyLookup], "'", "''") & "'")

For the second (which will fail if you have a company name containing a
doublequote), use

    rs.FindFirst "[Client Name] = """ & Me![CboCompanyLookup] & """"

That's three " before the value, and four after.
-- 

             John W. Vinson [MVP]


0
John
3/25/2010 6:41:19 PM
Reply:

Similar Artilces:

I keep getting and error on start of Office x.v
I just purchased Office X.v and installed it onto my Mac. I also removed Office Test Drive before installing the full Office X.v, but i didn't empty my trash. So after I installed the full version i keep getting the error "An unexpected error occurred while trying to load Microsoft Framework X library" on all office programs. I read on mactopia that this could be caused by "lock" identities in the microsoft identity file, but all of mine are unlocked. When i tried to empty my trash, it would not empty a few microsoft file because it says they are in use. Framework ...

MSVCRT.DLL error...
Recently, when starting Outlook 2000, I started getting the message: "OUTLOOK caused an invalid page fault in module MSVCRT.DLL at 0167:7800d4fl." & Outlook quits. I have tried the following: Making sure I had the latest service packs & updates Ran the repair office option from the install disk Completely removed & re-installed Office 2000 Replaced the MSVCRT.DLL file from the Win98 disk Ran the MS Libraries update And am still getting the same results! Can anyone help? Thanks- FYI, I'm running Win98 on a PII 500MHz with 64MB Ram. (I know, it's a dinosaur!) ...

WMP 11 error C00D1163 (after update KB971513)
Windows Media Player 11 will not play DVDs. I always get error C00D1163 "Windows Media Player cannot play this DVD because there is a problem with digital copy protection between your DVD drive, decoder, and video card. Try installing an updated driver for your video card." DVDs I have owned for years are now impossible to play (so are rentals). I am having the same problem as others in this forum, although my system configuration is different -- which indicates this is a widespread problem. It is an interesting coincidence that my problem started immediately ...

clicking TOOLS/OPTIONS gives me error msg "cannot access dir D:/"
I need to change settings in the TOOLS/OPTIONS menu. But when I click on any tab in the OPTIONS menu it gives me the error message "cannot access dir D:/documents" I may have changed the name of that directory at some point and I suspect that is the problem. However I still need to change settings in the TOOLS/OPTIONS menu. How do I fix it? Hi Lori Close Excel Add this directory D:/documents and try again And try again -- Regards Ron de Bruin http://www.rondebruin.nl "Lori Rossi" <Lori Rossi@discussions.microsoft.com> wrote in message news:34A25E1A-D...

Outlook Web Access error
Got this error message when trying to access my mailbox from Outlook Web Access. "Unable to get renderer" This happened on a particular machine but work fine on other machine. Anyone know what going on? ...

Error in code exportin tables to excel
I'm tryin to export a table to excel with the code: Private Sub Command4_Click() On Error GoTo Err_Command0_Click Dim stDocName As String stDocName = "F01_UT" DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, F01_UT, "C:\TRY\Tbls", True Exit_Command0_Click: Exit Sub Err_Command0_Click: MsgBox Err.Description Resume Exit_Command0_Click End Sub However, Access displays the message: Compile error : Syntax error What I'm doing wrong? If I want to export more tablas do I have to write more lines (DoCmd.TransferSpreadsheet acExport, acSpr...

Help with
I am currently in the process of migrating exchange 2000 to exchange 2003 on new hardware. I have transfered the RUS role, offline address book role and replicated the public folders ect. and now am beginning to move maiboxes. I noticed 3 very repetive errors in the application event log however. I was wondering if someone could tell me whether these messages are somthing I should be concerned with. See them below. So far I have no user complaints about outlook. Thanks. Event ID: 9320 Source MSExchangeSA Type Warning Description OALGen could not generate full details for some en...

Very strange problems while running Great Plains on workstations
I notice that a few workstations in an office I support are having problems when they run Great Plains. Excel, Outlook, Word and Dynamics.exe are showing in the Application event log as being Hanging or Faulting. I also see Fault Bucket errors, but when I search online I cannot find any information online. Here is one of the Fault Bucket errors: 3:15:35 pm 28-Sep-06 Application Hang None 1001 N/A Fault bucket 296734104. Also, these workstations are experiencing problems printing PDF files. Has anyone out there seen this behavior and if so, how can these problems be fixed? Thank you, ...

Sent Mail Error Outlook Express
IN OUTLOOK EXPRESS WHEN I SEND E-MAIL I GET AN OUTLOOK EXPRESS MESSAGE BOX THAT SAYS Some errors occurred while processing the requested tasks. Please review the list of errors below for more details. BUT THERE ARE NO DETAILS. THE EMAILS ARE NOT GOING TO THE SENT MAIL FOLDER. THE EMAILS ARE BEING DELIVERED AND RECEIVED BUT ON MY END THEY REMAIN IN THE OUTBOX AND ARE NOT GOING TO THE SENT MAIL FOLDER. I MUST CLEAR THE OUTLOOK EXPRESS ERROR BOX THEN DRAG THE SENT? MESSAGE OUT OF THE OUTBOX SO IT WON'T BE SENT AGAIN. ALSO YESTERDAY ALL PREVIOUS EMAIL IN THE SENT MAIL FOLDER DI...

Errors after I installed SP4
I installed SP4 to Windows 2000 server. I am running exchange server 5.5. The users cannot access their mailbox. I made all the users administrators to enable access to their mailbox. I cannot create a new mailbox. I get an error when I create a new mailbox. Error: Event Type: Information Event Source: MSExchangeSA Event Category: General Event ID: 5011 Date: 8/31/2004 Time: 2:49:43 PM User: N/A Computer: RCI2 Description: Error You do not have the permissions required to complete the operation. occurred during address generation. Please help me. 1. Verify that the Exchange Service Ac...

VBA type mismatch error
Hello all, The following line is in an Excel function: j = Application.Find(v, Cells(cnt, 1).Value) When watched, v has a value of "s" with type variant/string. cells(cnt,1).value has a value of 2 with a type of variant/double. I assume that the type mismatch occurs because the character "S" can't be found in an integer. How do I get this to work? TIA. Pierre. -- Posted via a free Usenet account from http://www.teranews.com VBA has its own version of =find(). Take a look at VBAs help for InStr. =find() will return an error if there isn't a match. Dim j...

time/date stamp on email
i used microsoft outlook for email. i sent an email to another outlook user and i wanted to find out if he's read it or not. is there any way to view the time/date that the person reads the email ? if you requested a read receipt and if the recipient uses a program that is capable of replying, yes. otherwise, no. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchang...

Running processes
I just want to know what processes should be running on my pc. I think I may have unneccesary processes running because my pc runs so slow. Any comments would be very helpful. Thanks. "Juicy66" <Juicy66@discussions.microsoft.com> wrote in message news:37F633E6-8FD3-4CC0-962C-0801A86528A2@microsoft.com... >I just want to know what processes should be running on my pc. I think I >may > have unneccesary processes running because my pc runs so slow. Any > comments > would be very helpful. Thanks. This is a server newsgroup. Try posting your questi...

opencurrentdatabase error/help
dears, im opening an access03 database with vb6 like application.opencurrentdatabase("c:/documents and settings/admin/folder/database.mdb",true,"password") application.docmd.open"myform" application.docmd.maximise docmd.maximise included in form open event also in the database kindly help me with (1) after this code runs access opening with small rectangular window(half of screen vertically) even all access databases are opening this way (2) if the above said path changes for the database error 7866 occuring in error event i would like to include some c...

Error importing Quicksell 2000 data
I've followed the instructions exactly as indicated in the help file. When I reach the final step where the actual import is to take place I get the error: Invalid Object Name 'VersionHistory' SELECT TOP 1 Version FROM VersionHistory ORDER BY ID DESC It appears that it's having a problem with the Access database when it tries to retrieve the latest version number of Quicksell 2000 (which is 3.01 on our system) I've used the QS2000 doctor to compact and repair the database, but the problem still exists. Any suggestions are appreciated. If you can ZIP the datab...

Publisher 97 unable to do Mail Merge
I can not get Publisher 97 to do Mail Merge with Excel 97. Here's what happens: Mail Merge / Open Data Source / PUBMERGE Out of memory. Mail Merge / Create Publisher Address List / PUBMERGE Out of memory. Mail Merge / Edit Publisher Address List / PUBMERGE Out of memory. but, for some reason, Word 97 will do Mail Merge with Excel 97, no problem .. . . Publisher 97 System Requirements, and what I'm running: 386DX, 486DX: Pentium 4, 2.8 GHz MS Windows 95: XP 6 MB RAM, 8 MB: 2 GB C:\WINDOWS\system32\ . . . I have JET Engine DLL 5.1.2600.0 I am thinking that this this could be ...

Re: Outlook client installation error (file or assembly name not found) (solved)
"Steve Yates" <steve@teamITS.com> wrote in message news:... > We have one PC that gets the following error and can't get past the system > requirements phase of the desktop client installation: > > "Microsoft CRM Client for Outlook Setup User Input > File or assembly name 9o3db28v.dll, or one of its dependencies, was not > found." > > (the file name is random and changes on every installation attempt). Any > suggestions? The user has tried repairing and reinstalling Office, > installing and uninstalling .NET 2.0, verifying/empytin...

How do I calculate the percentage of email i receive over time
I would like to find a formula that calculates the amount of emails i receive, daily, weekly, monthly, and yearly -- pearl Assuming the total number of emails in A1 and the beginning date for the period in B1: =A1/(YEAR(NOW())-YEAR(B1)+1) gives average per year =A1/INT(NOW() - B1) gives average per day =A1/INT(NOW() - B1)*7 gives average per week =A1/(((YEAR(NOW())-YEAR(B1))*12)+MONTH(NOW())) will give you average per month "Pearl" wrote: > I would like to find a formula that calculates the amount of emails i > receive, daily, weekly, monthly, and ye...

Error Message
I've started getting the following message each time I sign on to money. Due to Changes in your Money file, the saved version of the "Portfolio Value by Investment Account" report is no longer valid. Money has attempted to reset the report, but you should reset it manually to avoid unreliable information. I've tried to reset the report manually but to no avail. Anyone have any ideas / solutions ? In microsoft.public.money, greggoz wrote: >I've started getting the following message each time I >sign on to money. > > Due to Changes in your Money fil...

Money 2007 Installation Error
My PC runs Windows XP and Money 2007 gives me an error during installation: "Setup was unable to install some of the components needed to run Money. Try installing Money again". Of course, running install again gets the same error. What should I do? Otis, check this thread: http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?query=Setup+was+unable+to+install+some+of+the+components+&dg=microsoft.public.money&cat=en_us_3cae8298-078c-4734-b707-9e08dca21769&lang=en&cr=us&pt=&catlist=&dglist=&ptlist=&exp=&sloc=en-us It wor...

CRM 3.0 Service Calendar, Server Error in '/' Application
Hi I have been chasing this error for a while now with no success. When viewing the Service calendar or Creating a new Activity we get an error that would appear to be some issue with a date format somewhere. (error message at bottom of post) I have checked that the CRM application in IIS is running under dot.net 1.1, I have installed all service roll ups and hot fixes, I have stood on my head and prayed to all the MS gods that I know of - does anyone have any new ones I can try? It seems to have appeared after I installed some C360 add ons - removing them however has not fixed the is...

Automating CompactRepair--"db in use" error
I ran the following line of code from a db, called "writer.db". Application.CompactRepair "projecttrack.mdb", "db1.mdb", True It worked great, creating both the "db1.mdb" file and a log file. I erased the db1.mdb & the log file, and tried to run it again, and it failed, giving the following error: "Runtime error 7866. Microsoft cannot open the database because it is missing or opened exclusively by another user." I've closed all my copies of Access and reopened them, tried running again and get the sam...

5 Updates fail with Error Code: 0x80070005
I am running Windows XP Home Service Pack 3 and was keeping up to date with updates until about a month ago when Windows Update offered about 10 different Security Updates on one day. Now, after running Windows Update I keep getting the message that the following 5 updates have failed to install, even though other updates do install in the same run. Security Update for Windows XP (KB975713) Security Update for Windows XP (KB978037) Security Update for Windows XP (KB975560) Security Update for Windows XP (KB977914) Security Update for Windows XP (KB978706) All these updates...

syntax error in string
Can anyone tell me what's wrong with the syntax in this? I've tried single quotes, double quotes and a combo of both but I still get an syntax error message. stLinkCriteria = "[CustomerID]=" & Me![CustomerID] -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200708/1 What's the data type of CustomerID? If it's text, try: stLinkCriteria = "[CustomerID]=""" & Me![CustomerID] & """" Thats' 3 double quotes before, and 4 double quotes after. -- Doug...

unable to view or edit signature outlook 2003 error
i have tried all obvious solutions and nothing seems to work. i can create a signature but it will not remain. the only thing that jumps out at me is that i have noticed that there are %APPDATA% folders all over the place. i am not sure what is causing that.... I have searched for a solution and have found some people with the same issue but no solution that will work. Thanks! Where do you see the appdata folders? (signatures are stored in a folder under appdata) -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solution...