Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Expert One-on-One Access Application Development
This is the forum to discuss the Wrox book Expert One-on-One Microsoft Access Application Development by Helen Feddema; ISBN: 9780764559044
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Expert One-on-One Access Application Development 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
  #1 (permalink)  
Old July 12th, 2006, 11:38 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hung up on Ch 2, Pg 53 - new to VB

I've created a couple of form queries modeled directly after the examples in the book and I'm having troubles with text IDs.

I have three tables that query with numeric IDs just fine, but when I try to use a text ID, I get the following alert:

Quote:
quote:
Compile error:

Can't find project or library
I click OK and see a yellow arrow pointing to:
"Private Sbu cboSelectOwner_AfterUpdate()"
and Chr$(34) is highlighted in grey.

When I use the toggle breakpoint button it highlights the line that Chr$(34) is on in dark red. Is there something wrong with the syntax here? I have it written as:
Quote:
quote:strSearch = "[Organization] = " & Chr$(34) & Me![cboSelectOwner] & Chr$(34)
Thank you,

xxxiii

  #2 (permalink)  
Old July 13th, 2006, 12:03 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A bit more study, trial and error this morning, and I keep having problems when using text IDs.

I replaced the Chr$(34) with """, which got it to run through the line; but when I select one of the combobox items, nothing happens.

However, I can scroll through the various combobox items using the navagation.

BTW, I'm using a lookup table for the combobox and a datasheet subform for the results. This setup works great when the search string is numeric.

  #3 (permalink)  
Old July 14th, 2006, 04:55 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

VBA kept hanging on Chr(34) and Chr$(34), so I ended up using a double-double quote to return a single-double quote. Same result, different method.

Quote:
quote:strSearch = "[owner] = """ & Me![cboSelectOwner] & """"
Though my "workaround" was a success, I still don't know how to fix the Chr(34) issue. I read that it's a missing reference, but saw nothing on how to fix it.

I hope this helps someone someday.

  #4 (permalink)  
Old July 14th, 2006, 06:13 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Isn't character 34 (")? What happens when you use character 39 (')?
So that the WHERE evaluates to (owner = 'cboselectowner') once VBA runs through it?
ie: strSearch = "[owner] = '" & me.cboselectowner & "'"
or strSearch = "[owner] = " & chr(39) & me.cboSelectOwner & chr(39)

(Note: cboselectowner default value is text)

HTH,
Loralee

  #5 (permalink)  
Old July 20th, 2006, 09:25 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, right now I'm more concerned with figuring out how to get the ascii character codes to work in access 2k. They seem to work fine in my other office 2k applications.



Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net 2.0 (VB) error try it out ch 5 pg 160 rdixon2005 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 January 10th, 2008 02:37 PM
Ch 5 Arrays Pg 134 Sadlowski BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 February 23rd, 2006 01:25 PM
Ch 2 Page 53: Undefined index: authuser Airidh BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 25 February 22nd, 2005 07:34 PM
CH 5 pg 160 wadesmart BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 8 November 12th, 2003 11:23 PM
CH 3 pg 76 wadesmart BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 October 26th, 2003 08:46 PM





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