Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Merge two fields and having different fontsize

Posted on 2001-07-26
14
Medium Priority
?
273 Views
Last Modified: 2012-06-27
I do have a field [Info] and one field [from]. I a report, I want to merge this two field into one. Having both next to each other does look ugly regarding the varying length.

In the merged field, I want to show the [Info]text in FontSize 10 and the [from] txt in FontSize 6. How to do?

Thank you
ColumA
0
Comment
Question by:ColumA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +3
14 Comments
 
LVL 12

Expert Comment

by:Paurths
ID: 6321315
hi ColumA,

hope i am wrong , but...
no can do.

like i said, hope i am wrong.
cheers
Ricky
0
 

Expert Comment

by:jean062597
ID: 6321339
hi, i agree with paurths, i think it's not possible. you'll have to do away with having the same font size with the merge field. :)

good luck!

jean
0
 
LVL 2

Expert Comment

by:DanielBlais
ID: 6321547
merge them in a query

like
"select [a] & [b] as ab from tableab"

use ab in your report
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ColumA
ID: 6322135
I merge them in the report and have tried like

me.txt = [info]&" "& Format([from];"FontSize 6")

but this shows me.txt in the same Font.
0
 
LVL 2

Expert Comment

by:DanielBlais
ID: 6322175
oh, I didn't see that they must have different font size.

So, you need to label and recalculate the position in vba.
0
 

Author Comment

by:ColumA
ID: 6322282
Labeling the fields and then merge does not work. I belive that it won't work. I leave the question in the hope, that somebody might have an answer.
0
 
LVL 2

Expert Comment

by:DanielBlais
ID: 6322328
I did a typing mistake.  You need TWO labels or text fields.  And you need to recalculate the position.  It works, I already did it.
0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 6322907
ColumA:

>I leave the question in the hope, that somebody might have an answer.

I have the answer. Give me a bit to compose my solution.

-Dennis Borg
0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 6323010
ColumA:

You can best achieve this objective by printing the values from those fields directly onto the report.



Here is my suggestion:

1) If you haven't already, add text boxes for both the Info field and the From field. Set their Visible properties to False.

2) Position the Info text box on the report where you want this combination to appear. The position of the From field does not really matter.

4) Set the Detail Section's OnFormat Property to [Event Procedure], and add the following code to the event procedure:

   CurrentX = Info.Left
   CurrentY = Info.Top
   FontName = Info.FontName
   FontSize = 10
   Print [Info] & "-";
   FontSize = 6
   Print [From]


This will cause the two fields to be printed together, each with their own font size.


-Dennis Borg
0
 
LVL 2

Expert Comment

by:hotbudare
ID: 6324033
You'll have to use a richtext control ...

HTH/EQTA
T.S.U. Mario Osorio
Punto Fijo, Falcon, Venezuela
0
 

Author Comment

by:ColumA
ID: 6326142
Thank you Dennis,

your solution works. Pls give me one last hint before I transfer you the points. The [from]comes now on the upper end of the [Info] text. How to get [from]-text on the same line as [Info].

Thank you
ColumA
0
 
LVL 8

Accepted Solution

by:
DennisBorg earned 600 total points
ID: 6326960
We'll use the [From] textbox to control the vertical placement of that text; and we'll still ignore [From]'s horizontal placement.

First, set the FontSize of the textbox [Info] to 10. Then set the FontSize of the textbox [From] to 6. Double-click on the size handles of each, which causes them to be auto-resized (to match the font size).

Next, align [From]'s vertical placement so that the font baseline of the [From] textbox lines up with that of the [Info] text box.

Then, use the following revised code in the detail section's OnFormat event procedure:


  CurrentX = Info.Left
  CurrentY = Info.Top
  FontName = Info.FontName
  FontSize = Info.FontSize
  Print [Info] & "-";
  FontSize = [From].FontSize
  CurrentY = [From].Top
  Print [From]

I believe that should do the trick for you.

You can now use the FontName and the FontSize properties of the [Info] and [From] textboxes to control how [From] and [Info] are printed. The vertical and horizontal position of [Info] controls where the printing starts, and the vertical position of the From field controls the vertical placement of the [From] text.


-Dennis Borg
0
 

Author Comment

by:ColumA
ID: 6327794
Perfect

Thank you Dennis for your help. I added 50 more points for the prompt answer
have a nice wknd
ColumA
0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 6328176
ColumA:

>Perfect
>
>Thank you Dennis for your help. I added 50 more points
>for the prompt answer
>have a nice wknd

Well, thank you very much, ColumA. I appreciate it! And I'm glad I could help.

You also have a great weekend. I plan on catching up on some much needed sleep after the past rough weeks. But I also have to quite a bit of work for a client of mine who needs a report developed soon.

Take care and thanks again,

-Dennis Borg
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question