Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 2nd, 2005, 04:18 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combo Box errors

Hi All
I have set up a combo box on a form.In the records there are records commencing O'Sullivan but when I try to retrieve these records it gives errors.Is there any way round this problem.

Thanks
Brendan

__________________
Brendan Bartley
 
Old September 2nd, 2005, 06:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Depending what code you're running after you choose the name, you could be experiencing problems with the apostrophe in "O'Sullivan". What is the exact error and the code that produces it?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old September 2nd, 2005, 07:57 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Error no 3077 Description:Syntax error (Missing operator)in Expression

 
Old September 2nd, 2005, 08:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

And what is the actual code where this happens?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old September 2nd, 2005, 08:31 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default

   Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[OFFICE] = '" & Me![Combo8] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

 
Old September 2nd, 2005, 08:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Sounds like an apostrophe problem to me. Have a look at this discussion. It talks about first changing the ' to a double '' and THEN making the comparisons. It may be what you need.

http://p2p.wrox.com/topic.asp?TOPIC_ID=5655


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old September 2nd, 2005, 10:34 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Brendan,
Try this:

rs.FindFirst "[OFFICE] = " & """" Me![Combo8] & """"

Kevin

dartcoach
 
Old September 2nd, 2005, 12:42 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Brendan,
Connell,John, "Beginning Visual Basic 6 Database Programming", by Wrox,page
259,Checking and Fixing Records with Apostrophes.
If after expert advises u are not out of troubles, text books may help, u
should check the title above if possible.
rgds Penta






Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a text box from a combo box value dnf999 Access VBA 7 February 6th, 2012 02:24 PM
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
Populate List Box by Combo Box Selection mmcdonal Access 2 June 15th, 2004 12:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.