Combo box maximum character length.

G

Guest

I have a combo box that pick up values from a query. I cannot figure out why
if you type a string in the combo box the maximum length is 50 characters.
The query find values in a table and the combo box store value in a field
that is 255 characters on the NotInList event. So if the field is 255
characters why cannot I type more than 50 characters in the combo box?
Thanks
 
G

Guest

Thanks for replying.
The lenght of the field specified in the ControlSource property is 255
characters (Text field).
 
J

John Vinson

I have a combo box that pick up values from a query. I cannot figure out why
if you type a string in the combo box the maximum length is 50 characters.
The query find values in a table and the combo box store value in a field
that is 255 characters on the NotInList event. So if the field is 255
characters why cannot I type more than 50 characters in the combo box?
Thanks

Is it 255 characters in BOTH tables - the Control Source and also the
Row Source?

John W. Vinson[MVP]
 
G

Guest

Thanks for replying.
The control source is a 255 characters field.
The row source is a query. Exactly:
SELECT [_tbl10ProjectTitleValues].ProjectTitle,
[_tbl10ProjectTitleValues].Division, [_tbl10ProjectTitleValues].Manager
FROM _tbl10ProjectTitleValues
WHERE
((([_tbl10ProjectTitleValues].Division)=[Forms]![frmLogin].[cboDivision]) AND
(([_tbl10ProjectTitleValues].Manager)=[Forms]![frmLogin].[cboManager]))
ORDER BY [_tbl10ProjectTitleValues].ProjectTitle;
 
J

John Vinson

Thanks for replying.
The control source is a 255 characters field.
The row source is a query. Exactly:
SELECT [_tbl10ProjectTitleValues].ProjectTitle,
[_tbl10ProjectTitleValues].Division, [_tbl10ProjectTitleValues].Manager
FROM _tbl10ProjectTitleValues
WHERE
((([_tbl10ProjectTitleValues].Division)=[Forms]![frmLogin].[cboDivision]) AND
(([_tbl10ProjectTitleValues].Manager)=[Forms]![frmLogin].[cboManager]))
ORDER BY [_tbl10ProjectTitleValues].ProjectTitle;

What is the size of the ProjectTitle field in
[_tbl10ProjectTitleValues]?

John W. Vinson[MVP]
 
G

Guest

It's a string field 255 characters.
--
Regards,
kory.


John Vinson said:
Thanks for replying.
The control source is a 255 characters field.
The row source is a query. Exactly:
SELECT [_tbl10ProjectTitleValues].ProjectTitle,
[_tbl10ProjectTitleValues].Division, [_tbl10ProjectTitleValues].Manager
FROM _tbl10ProjectTitleValues
WHERE
((([_tbl10ProjectTitleValues].Division)=[Forms]![frmLogin].[cboDivision]) AND
(([_tbl10ProjectTitleValues].Manager)=[Forms]![frmLogin].[cboManager]))
ORDER BY [_tbl10ProjectTitleValues].ProjectTitle;

What is the size of the ProjectTitle field in
[_tbl10ProjectTitleValues]?

John W. Vinson[MVP]
 
T

TC

Sorry not to reply before. I was in the ozzie outback (sorta!), and it
was difficult to find a free access point. (beer was not a problem ...)

Let's divide & conquor.

Double-click the query directly in the query window, to see the results
in a datasheet. Then type into the field in question (in that
datasheet), & see if the limit of 50 chars is still applied, or not. If
it *is*, then, it simply must be somehing to do with the field, or the
query. If it *isn't*, then, it must be something to do with the combo
box, or the code behind the form.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Guest

Nothing is wrong with the query. The field can accept 255 characters. As far
as regarding the combo box the only problem could come from the code behind
the "not in list" event. The code is as follow:
Private Sub Project_NotInList (NewData As String, Response As Integer)

Dim strSql as String
'Prompt user to confirm the selection
If MsgBox("'" & NewData & "' is currently not an existing Project Title. " &
vbCrLF _
& "Would you like to add this new Project Title to the menu?", vbQuestion +
vbOkCancel, "Information") = vbOK Then
strSql = "Insert into [_tbl10ProjectTitleValues] (ProjectTitle,
Division, Manager) Values ('" & NewData &"', '" & Me.cboDivision "', '" &
Me.cboManager &"')"
CurrentDb.Execute strSQL
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub

Could NewData be limited to 50 characters. I don't think so and so I still
have my problem without any solution. ;-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top