Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 October 7th, 2010, 11:15 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Error: A problem occurred while Microsoft office Access was communicationg with the O

Hello Everyone,

Please help me.

I am building a subform (using table [Sub Objects, Sub Object Titles]) which has Subobject (combo box) and Title (list box) fields on the Form.
On Form Subobject field, I select subobject and title from [Sub Objects, Sub Object Titles] because I want to user see these, so I put “Bound Column”=2; Then on Title field, it should show the title which relates with Subobject. Here is my code:
***
Private Sub SubObject_AfterUpdate()

Me.Title.RowSource = "select Title from [Sub Objects, Sub Object Titles] where SubObject=" & Chr(34) & Me.SubObject & Chr(34)
End Sub

But I got this error message:
The expression after update you entered as the event property setting produced the following error: A problem occurred while Microsoft office Access was communicationg with the OLE server or activeX Control

Thanks,
Cindy
 
Old October 7th, 2010, 12:20 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

Cindy,

Sounds like you are trying to create cascading controls.

See this example:
Cascading Combo Boxes Using 2 Tables

Note that the bound column of a combo box is the column that is stored. The column that is displayed is the first column with a display width greater than 0".
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 7th, 2010, 02:19 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Yes, but a little bit different

Hi HiTechCoach,

Thanks again for your response. I think you are right, but my two fields are in the same level (in the datasheet). For example: PK is combox, and RowField is list box. if PK=1, then RowField=Row1; if PK=12, then RowField=Row6
(my example, PK and Row1 are one to one relation).

Thanks,
Cindy
 
Old October 7th, 2010, 02:37 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

You should always set the bound column to be the field that is the primary key for a list box or combo box that uses a table as the row source.

If the combo box and list box both have the same table as the row source then they will both be bound to a column which is the same primary key field in the table.

The difference between the combo box and list box will be in which column (field from the table) is displayed.

Would you please post the table structure (fields) for the table [Sub Objects, Sub Object Titles].
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 7th, 2010, 03:49 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default table

Thanks, HiTechCoach.
Here is the table fields:

Field Name Data Type

SubObject text
Title text
rate currency
AllowedtoPlan yes/no
PlanGrantOnly yes/no


Thank you very much,
Cindy
 
Old October 7th, 2010, 03:56 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

What field is the primary Key?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 8th, 2010, 08:48 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Primary Key

SubObject is the primary key.

Thank you so much HiTechCoach!

Cindy
 
Old October 10th, 2010, 09:34 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Project and projectDetail Forms link by ID (Autonumber)

Hello HiTechCoach,
My Master Form project and subform projectDetail link by hiding field ID which is the autonumber and primary key from project table and projectdetail table. These forms are for adding a new record. The Master Form has Schoolyear, projectname, projectManager........some fields use value lists, some fields use query to get value come from another table fields. When the record has been saved, they will be saved in project table. For sumform projectdetail, SubObject and Tilte fields use the value come from [Sub Objects, Sub Object Titles], and also on this subform, I also have planningAmount and descr fields. Since the SubObject (comb box-drop down) and Title (I think I should use text box instead of list box) come from [Sub Objects, Sub Object Titles], so I want this: When user choose a value from Subobject drop down list, the Field--Title shows up the value which the Subobject = the value which user chose. Because on the table [Sub Objects, Sub Object Titles], Subobject field is primary key and it is unduplicated field. on the subform, planningAmount and descr fields are text box, data entry by user.

if my explaining is still not clear, please let me know.

Thanks,
Cindy
 
Old October 11th, 2010, 11:41 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

Are you just wanting to show the "Title" for the select SubObject in the combo box?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 12th, 2010, 09:05 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Yes, only show the Title

Thanks, HiTechCoach.
Yes, only show the Title which SubObject selected from SubObject Combo box. Rest of the fields in the subform are the data entry fields.

Thanks,
Cindy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Office Excel has stopped working. David Wilkinson BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 7 September 6th, 2010 09:49 AM
How to Use Microsoft Office Spreadsheet in Access TomW Access VBA 1 November 18th, 2008 03:32 PM
Microsoft Office Web Components 9.0 (0x800A03EC) rekha_jsr Classic ASP Components 1 February 4th, 2006 08:19 PM
[ODBC Microsoft Access Driver] !!!Error!!! Varg_88 Classic ASP Databases 3 August 30th, 2004 06:19 AM





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