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

Now that is really easy to do. You must first make sure that "title" is in a column in the combo box. It does not have to be visible ( column width of 0").

Add this to text box's control source:

Code:
=SubObject.Column(2)
Notes: You will need to change the number for the column index from 2 to the actual column number.number. The column index is also zero based. This means the first column is index 0, then second column is index 1, etc.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 13th, 2010, 09:48 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default I still have not succeed on this one

Hello HiTechCoach,
I still have not succeed on this one. Do you have any suggestion?

Thank you so much,
Cindy
 
Old October 13th, 2010, 11:30 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Still have some problems

Hello HiTechCoach,

Sorry, I didn't see your last email. After saw your last email, and I tried your suggestion, but I got this error message when I selected the item for SubObject Combo box: “The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.”
Format for SubObject Combo box:
Column count: 2;
Column widths:0.4”;0”;
Bound column: 2.

And also, for text box Title, I put Control source=SubObject.Column(2), but it seems like nothing shows up in Title.

Thank you very much,
Cindy
 
Old October 13th, 2010, 11:47 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

The index value for a combo box is zero based. This means the first column has an index value of 0 not 1. So the second column's index value is 1 not 2.

Try this in the control source of a text box:

=SubObject.Column(1)
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015

Last edited by HiTechCoach; October 13th, 2010 at 12:07 PM..
 
Old October 13th, 2010, 04:39 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default Title is correct, but

Thanks, HiTechCoach! Title shows up is correct:-)!
But, just sometime, it still gives me “The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.”

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

Do you have VBA code someplace that is trying to assign data to a control?

Are you running an Append query someplace?
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 13th, 2010, 05:21 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default my answer

Hello HiTechCoach,

I don't use append query for this project, but I do use passing 2 values from Form to Form.
***
Private Sub ComOpenSelect_Click()
On Error GoTo Err_ComOpenSelect_Click
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FRM_EditProjects"
stLinkCriteria = "[IndexCode]= " & Chr(34) & Me![IndexCode] & Chr(34)
stLinkCriteria = stLinkCriteria & " and [ProjectName]=" & Chr(34) & Me.[ProjectName] & Chr(34)

DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ComOpenSelect_Click:
Exit Sub

Err_ComOpenSelect_Click:
MsgBox Err.Description
Resume Exit_ComOpenSelect_Click

End Sub

Thanks,
Cindy
 
Old October 14th, 2010, 09:28 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default forgot this

Hello HiTechCoach,
I forgot to tell you this:

when I added record in the subform, the first row seems okay, no error message shows up. when I added data in secord row, the error started showing up.

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.