Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Text Box not listing all data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zoltar54 - 04 Jul 2007 17:46 GMT
I have a text box on my form which is populated based on a selection made in
a combobox.  I have used the VBA code below and it does to work to some
extent however not all of the text is showing.  I have verified that the size
for the underlying tables are set to maximum (255) but to no avail.  Can
someone please help?

Private Sub ServiceID_AfterUpdate()
Dim strfilter As String

On Error GoTo errorhandler

Me.Description = serviceid.column(3)
Exit Sub

errorhandler:
   MsgBox "Error#" & Err.Number & vbCrLf & Err.Description
John W. Vinson - 04 Jul 2007 20:53 GMT
>I have a text box on my form which is populated based on a selection made in
>a combobox.  I have used the VBA code below and it does to work to some
[quoted text clipped - 12 lines]
>errorhandler:
>    MsgBox "Error#" & Err.Number & vbCrLf & Err.Description

What's the RowSource of the ServiceID combo? Please post the SQL. What's the
datatype and size of the fourth field in the rowsource query? What are you
seeing, and what do you expect to see?

If the fourth field is a Memo field it will be truncated in the combo box;
might that be the problem? An alternative would be

Me.Description = DLookUp("[descriptionfieldname]", "[tablename]", _
    "[ServiceID] = " & Me.ServiceID)

            John W. Vinson [MVP]
Zoltar54 - 05 Jul 2007 14:22 GMT
I used your suggestion however the problem persist.  The source table
(tblService) is set as a text field with the length set to 255.  Here is the
rowsource for the cmbService:

SELECT tblservice.serviceID, tblservice.Service, tblservice.CategoryID,
tblservice.Description FROM tblService WHERE
(((tblService.CategoryID)=[]![CategoryID]));

In terms of my code, I have specified a variable (strfilter) as string.  
Should I define strfiler in the code (eg: strfilter= "ServiceID=" &
me.serviceid)

Z

> >I have a text box on my form which is populated based on a selection made in
> >a combobox.  I have used the VBA code below and it does to work to some
[quoted text clipped - 24 lines]
>
>              John W. Vinson [MVP]
John W. Vinson - 05 Jul 2007 17:56 GMT
>I used your suggestion however the problem persist.  The source table
>(tblService) is set as a text field with the length set to 255.

That doesn't parse. A *table* might contain a 255 byte text field, but saying
that "the source table is set as a text field" is meaningless. A table isn't a
field and can't be "set as" a field. I just don't understand what you mean
here!

> Here is the
>rowsource for the cmbService:
>
>SELECT tblservice.serviceID, tblservice.Service, tblservice.CategoryID,
>tblservice.Description FROM tblService WHERE
>(((tblService.CategoryID)=[]![CategoryID]));

I'm astonished that works at all. What is intended by the peculiar []!
syntax!?

>In terms of my code, I have specified a variable (strfilter) as string.  
>Should I define strfiler in the code (eg: strfilter= "ServiceID=" &
>me.serviceid)

What does strFilter have to do with this combo box? Where is the value of
CategoryID supposed to come from? I'm simply not seeing the whole picture
here!

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.