473,436 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,436 software developers and data experts.

customizing fields in query results: datasheet view

6
Hello,
So I once took a class in Access but have since forgotten if this is possible or not....I have set up a switchboard that runs a macro query to display list of results in datasheet view. The last field in the datsheet is a "notes" field. I have been receiving complaints that the notes entered in the field run off the screen and therefore are difficult/time consuming to read. I am looking for a way to keep the information in the notes field confined so that:

The text will look like this
The text will look like this
The text will look like this
The text will look like this

And not:

The text will look like this. this. this. this. this. this. this. this. this. this. this.

Any help greatly appreciated.
Aug 27 '07 #1
7 2491
FishVal
2,653 Expert 2GB
Hello,
So I once took a class in Access but have since forgotten if this is possible or not....I have set up a switchboard that runs a macro query to display list of results in datasheet view. The last field in the datsheet is a "notes" field. I have been receiving complaints that the notes entered in the field run off the screen and therefore are difficult/time consuming to read. I am looking for a way to keep the information in the notes field confined so that:

The text will look like this
The text will look like this
The text will look like this
The text will look like this

And not:

The text will look like this. this. this. this. this. this. this. this. this. this. this.

Any help greatly appreciated.
Hi, there.

Try smthng like this
Expand|Select|Wrap|Line Numbers
  1. SELECT .............., IIf(Len([txtLongText])>15,Left([txtLongText],15) & "...",[txtLongText]) AS [Truncated text]
  2. FROM tblTable;
  3.  
Aug 27 '07 #2
missinglinq
3,532 Expert 2GB
You can adjust the width of a given field in a query, just as you would in a datasheet form view or a spreadsheet, for that matter. You can also adjust the height of each row, in the same manner. The problem is, obviously, that you have to adjust the height of the entire row, not just the memo field! Because of this the whole thing looks rather ungainly, and the number of rows/records visible at any given times becomes rather limited!

A more sensible approach to this problem would be to use the query as the Record Source for a form, done in datasheet view. The form can then be opened from the switchboard. You can use the Forms Wizard to create the form, and it will look identical to the query display. You can size the width of the memo field to whatever you desire, but you can also use a little VBA magic to expand the memo field when your user needs to look at its content. In the Double Click event for this field use this code:
Expand|Select|Wrap|Line Numbers
  1.  Private Sub YourMemoFieldName_DblClick(Cancel As Integer)
  2.        DoCmd.RunCommand acCmdZoomBox
  3.  End Sub
  4.  
When the user needs to view the entire contents of the memo filed, they simply double-click on it, and it expands to show the entire contents.

Welcome to TheScripts!

Linq ;0)>
Aug 27 '07 #3
Jim Doherty
897 Expert 512MB
Hello,
So I once took a class in Access but have since forgotten if this is possible or not....I have set up a switchboard that runs a macro query to display list of results in datasheet view. The last field in the datsheet is a "notes" field. I have been receiving complaints that the notes entered in the field run off the screen and therefore are difficult/time consuming to read. I am looking for a way to keep the information in the notes field confined so that:

The text will look like this
The text will look like this
The text will look like this
The text will look like this

And not:

The text will look like this. this. this. this. this. this. this. this. this. this. this.

Any help greatly appreciated.
Not sure what you mean .....but have you considered looking at the 'Enter Key Behaviour' of the textbox concerned. NEW LINE IN FIELD (the inputter can then decide where it wraps themselves?) or are you saying you need to ensure that the textbox only carries with it a certain number of characters per line, at which point it must WRAP. (presumably though only where the maximum last character in the line is a space otherwise you might cut your words in half, quarters, fifths you name it.

Fishvals example is what I'd go with on the face of what you are describing and then on double clicking the field that Fishval outlines bring up a larger text box as a dialog to display the actual contents. (but even here we have to decide where wrapping starts and finishes if we are trying to replicate what you outline in your example) All of this depends does it not, on the width and height of your current notes textbox ie the available space you currently have on screen to deal with notes? or have I interpreted it wrong?

Jim
Aug 27 '07 #4
Jim Doherty
897 Expert 512MB
Not sure what you mean .....but have you considered looking at the 'Enter Key Behaviour' of the textbox concerned. NEW LINE IN FIELD (the inputter can then decide where it wraps themselves?) or are you saying you need to ensure that the textbox only carries with it a certain number of characters per line, at which point it must WRAP. (presumably though only where the maximum last character in the line is a space otherwise you might cut your words in half, quarters, fifths you name it.

Fishvals example is what I'd go with on the face of what you are describing and then on double clicking the field that Fishval outlines bring up a larger text box as a dialog to display the actual contents. (but even here we have to decide where wrapping starts and finishes if we are trying to replicate what you outline in your example) All of this depends does it not, on the width and height of your current notes textbox ie the available space you currently have on screen to deal with notes? or have I interpreted it wrong?

Jim
Whoops I qualify...I misread your posting you are using 'datasheet' only not a form saved in datasheet discount my posting, I assumed you were working in a form saved as datasheet
Aug 27 '07 #5
spk
6
You can adjust the width of a given field in a query, just as you would in a datasheet form view or a spreadsheet, for that matter. You can also adjust the height of each row, in the same manner. The problem is, obviously, that you have to adjust the height of the entire row, not just the memo field! Because of this the whole thing looks rather ungainly, and the number of rows/records visible at any given times becomes rather limited!

A more sensible approach to this problem would be to use the query as the Record Source for a form, done in datasheet view. The form can then be opened from the switchboard. You can use the Forms Wizard to create the form, and it will look identical to the query display. You can size the width of the memo field to whatever you desire, but you can also use a little VBA magic to expand the memo field when your user needs to look at its content. In the Double Click event for this field use this code:
Expand|Select|Wrap|Line Numbers
  1.  Private Sub YourMemoFieldName_DblClick(Cancel As Integer)
  2.        DoCmd.RunCommand acCmdZoomBox
  3.  End Sub
  4.  
When the user needs to view the entire contents of the memo filed, they simply double-click on it, and it expands to show the entire contents.

Welcome to TheScripts!

Linq ;0)>
Thanks to all for the quick replies.
I am going to try using the query as the Record Source for a form, done in datasheet view. As I said, I'm a little rusty with access, but I won't bother anyone with how to do that exactly until I've taken a look at it myself.

I did try creating an untitled form with the CmdZoomBox VBA and it works, but I'm still wondering if I can just wrap one field (text box)of the query in DS view after say 25 characters. This portion of the record is used least often, so breaking up the "flow" of the fields is not an issue (in other words I don't mind if the other fields in each record skip a row. I can always max out the char width to minimize how often it happens. Also, it's not terribly important that the wrap breaks at a space in the text. This query is for inhouse viewing only.
If it must be done in a form in DS view I'll do it that way, but for ease of use I'd rather not have to click or doubleclick on anything, if possible. Mouse-free, you know.

Hope this is making sense and I really appreciate the insight you've provided.

-Shawn
Aug 27 '07 #6
FishVal
2,653 Expert 2GB
Thanks to all for the quick replies.
I am going to try using the query as the Record Source for a form, done in datasheet view. As I said, I'm a little rusty with access, but I won't bother anyone with how to do that exactly until I've taken a look at it myself.

I did try creating an untitled form with the CmdZoomBox VBA and it works, but I'm still wondering if I can just wrap one field (text box)of the query in DS view after say 25 characters. This portion of the record is used least often, so breaking up the "flow" of the fields is not an issue (in other words I don't mind if the other fields in each record skip a row. I can always max out the char width to minimize how often it happens. Also, it's not terribly important that the wrap breaks at a space in the text. This query is for inhouse viewing only.
If it must be done in a form in DS view I'll do it that way, but for ease of use I'd rather not have to click or doubleclick on anything, if possible. Mouse-free, you know.

Hope this is making sense and I really appreciate the insight you've provided.

-Shawn
Hi, Shawn.

Despite you wouldn't like to move a mouse :) I'd like to suggest you a rather pretty solution which however requires some mouse clicks. I'm using it in a case of forms with many fields.
  • create a form for viewing in Datasheet mode including 3-4 fields just to recognize a record
  • add to the form subform based on the same table and set it view to Single form
Now you have a Datasheet convinient to browse through expanding subform as soon as a close look to a record is needed.
Aug 27 '07 #7
spk
6
Hello,
Haven't been here for a few days but did want to express my sincere and utmost gratitude for the very helpful (and prompt!!) suggestions from everyone.
I did wind up using a form as the record source for the query, opens in DS view and used the posted VBA to doubleclick and bring up a zoom box showing entire field contents. Client thrilled to bits about this, doesn't mind the doubleclicking at all.
Thanks again to everyone — wouldn't have been able to do this without ya!!
-Shawn
Aug 30 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JD | last post by:
I'm using MS Access 97 in an XP environment. I have an append query at the top of a query tree that is behaving strangely. From design view, I can choose view datasheet - and I see one set of...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
3
by: thomas goodwin | last post by:
I have a query which asks for a parameter value to execute it. To see the results I have to: a) click on the query -- the "Enter Parameter Value" window pops up. b) enter the parameter value c)...
2
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two...
0
by: ET | last post by:
We have two tables... one with primary key ID and second table with secondary key to the ID in the first table... Now, they query pulls records from both tables, looks like this: SELECT...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
4
by: zwasdl | last post by:
Is it possible to view access query (design view or sql view) and its query results in the same window (for example, arrange them side by side) as other DB software do? Thanks, Wei
8
by: olivero | last post by:
Hi group, Is there an easy way to make a form create the same set of fields dynamically, once for each record returned by a query? I have a query that's being called from a form and the results...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.