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

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

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

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

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

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

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

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