 |
| 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
|
|
|
|

October 7th, 2010, 11:15 AM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 7th, 2010, 12:20 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
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
|
|

October 7th, 2010, 02:19 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 7th, 2010, 02:37 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
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
|
|

October 7th, 2010, 03:49 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 7th, 2010, 03:56 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
What field is the primary Key?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
|
|

October 8th, 2010, 08:48 AM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Primary Key
SubObject is the primary key.
Thank you so much HiTechCoach!
Cindy
|
|

October 10th, 2010, 09:34 PM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 11th, 2010, 11:41 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
|
|
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
|
|

October 12th, 2010, 09:05 AM
|
|
Authorized User
|
|
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |