A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Changing font in rich text table



 
 
Thread Tools Display Modes
  #1  
Old April 19th, 2010, 02:46 PM posted to microsoft.public.access.forms
anthony
external usenet poster
 
Posts: 59
Default Changing font in rich text table

I want to standardise the font of all data in a table's rich text
field. If I use:

Dim DB As Database
Dim rst As Recordset
Dim strSQL As String
Set DB = CurrentDb()
strSQL = "SELECT tblReportTermly.Aims FROM tblReportTermly;"
Set rst = DB.OpenRecordset(strSQL)
Do Until rst.EOF
With rst
.MoveFirst
.Edit
!Aims.FontName = "Calibri"
!Aims.FontSize = "11"
.Update
.MoveNext
End With
Loop

i get "Object doesn't support this property or method". Am I
approaching this incorrectly?
Ads
  #2  
Old April 19th, 2010, 02:56 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Changing font in rich text table

On Mon, 19 Apr 2010 06:46:47 -0700 (PDT), anthony
wrote:

The reason for the error is that a field in a recordset doesn't have a
FontName property. It didn't show in intellisense either.
Rather you have to change the Value of this field:
..Edit
!Aims = ReplaceFontInfo(!Aims)
..Update

Now you write this function to do the actual work:
private function ReplaceFontInfo(byval s as string) as string
'TODO: Use Replace function and others to do the work, thus changing
s.
ReplaceFontInfo = s
end function

I'd have to see what the value s looks like before I could give more
suggestions. This may be difficult to fix in the general case.

-Tom.
Microsoft Access MVP



I want to standardise the font of all data in a table's rich text
field. If I use:

Dim DB As Database
Dim rst As Recordset
Dim strSQL As String
Set DB = CurrentDb()
strSQL = "SELECT tblReportTermly.Aims FROM tblReportTermly;"
Set rst = DB.OpenRecordset(strSQL)
Do Until rst.EOF
With rst
.MoveFirst
.Edit
!Aims.FontName = "Calibri"
!Aims.FontSize = "11"
.Update
.MoveNext
End With
Loop

i get "Object doesn't support this property or method". Am I
approaching this incorrectly?

  #3  
Old April 19th, 2010, 03:52 PM posted to microsoft.public.access.forms
anthony
external usenet poster
 
Posts: 59
Default Changing font in rich text table

On Apr 19, 2:56*pm, Tom van Stiphout wrote:
On Mon, 19 Apr 2010 06:46:47 -0700 (PDT), anthony

wrote:

The reason for the error is that a field in a recordset doesn't have a
FontName property. It didn't show in intellisense either.
Rather you have to change the Value of this field:
.Edit
!Aims = ReplaceFontInfo(!Aims)
.Update

Now you write this function to do the actual work:
private function ReplaceFontInfo(byval s as string) as string
'TODO: Use Replace function and others to do the work, thus changing
s.
ReplaceFontInfo = s
end function

I'd have to see what the value s looks like before I could give more
suggestions. This may be difficult to fix in the general case.

-Tom.
Microsoft Access MVP

I want to standardise the font of all data in a table's rich text
field. If I use:


Dim DB As Database
Dim rst As Recordset
Dim strSQL As String
Set DB = CurrentDb()
strSQL = "SELECT tblReportTermly.Aims FROM tblReportTermly;"
Set rst = DB.OpenRecordset(strSQL)
Do Until rst.EOF
* *With rst
* * * *.MoveFirst
* * * *.Edit
* * * *!Aims.FontName = "Calibri"
* * * *!Aims.FontSize = "11"
* * * *.Update
* *.MoveNext
* *End With
Loop


i get "Object doesn't support this property or method". Am I
approaching this incorrectly?


Thank you Tom. I had a horrid feeling it was going to be complicated!

Best - Anthony
  #4  
Old April 19th, 2010, 05:29 PM posted to microsoft.public.access.forms
anthony
external usenet poster
 
Posts: 59
Default Changing font in rich text table

On Apr 19, 2:56*pm, Tom van Stiphout wrote:
On Mon, 19 Apr 2010 06:46:47 -0700 (PDT), anthony

wrote:

The reason for the error is that a field in a recordset doesn't have a
FontName property. It didn't show in intellisense either.
Rather you have to change the Value of this field:
.Edit
!Aims = ReplaceFontInfo(!Aims)
.Update

Now you write this function to do the actual work:
private function ReplaceFontInfo(byval s as string) as string
'TODO: Use Replace function and others to do the work, thus changing
s.
ReplaceFontInfo = s
end function

I'd have to see what the value s looks like before I could give more
suggestions. This may be difficult to fix in the general case.

-Tom.
Microsoft Access MVP

I want to standardise the font of all data in a table's rich text
field. If I use:


Dim DB As Database
Dim rst As Recordset
Dim strSQL As String
Set DB = CurrentDb()
strSQL = "SELECT tblReportTermly.Aims FROM tblReportTermly;"
Set rst = DB.OpenRecordset(strSQL)
Do Until rst.EOF
* *With rst
* * * *.MoveFirst
* * * *.Edit
* * * *!Aims.FontName = "Calibri"
* * * *!Aims.FontSize = "11"
* * * *.Update
* *.MoveNext
* *End With
Loop


i get "Object doesn't support this property or method". Am I
approaching this incorrectly?


Alright, so I grab the value of the field (which will be a couple of
sentences of text), format it and then replace the contents of aims
with it. The question is: what syntax do I need to use to give the
variable's contents a font and a font size before replacing the
current contents of aims? Actually, I wonder whether I could put the
whole table into Excel, format it there and then re-populate...
  #5  
Old April 20th, 2010, 04:32 AM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Changing font in rich text table

On Mon, 19 Apr 2010 09:29:28 -0700 (PDT), anthony
wrote:

Apply some font and size before saving it to the table in the first
place. Then see what was created.

-Tom.
Microsoft Access MVP


On Apr 19, 2:56*pm, Tom van Stiphout wrote:
On Mon, 19 Apr 2010 06:46:47 -0700 (PDT), anthony

wrote:

The reason for the error is that a field in a recordset doesn't have a
FontName property. It didn't show in intellisense either.
Rather you have to change the Value of this field:
.Edit
!Aims = ReplaceFontInfo(!Aims)
.Update

Now you write this function to do the actual work:
private function ReplaceFontInfo(byval s as string) as string
'TODO: Use Replace function and others to do the work, thus changing
s.
ReplaceFontInfo = s
end function

I'd have to see what the value s looks like before I could give more
suggestions. This may be difficult to fix in the general case.

-Tom.
Microsoft Access MVP

I want to standardise the font of all data in a table's rich text
field. If I use:


Dim DB As Database
Dim rst As Recordset
Dim strSQL As String
Set DB = CurrentDb()
strSQL = "SELECT tblReportTermly.Aims FROM tblReportTermly;"
Set rst = DB.OpenRecordset(strSQL)
Do Until rst.EOF
* *With rst
* * * *.MoveFirst
* * * *.Edit
* * * *!Aims.FontName = "Calibri"
* * * *!Aims.FontSize = "11"
* * * *.Update
* *.MoveNext
* *End With
Loop


i get "Object doesn't support this property or method". Am I
approaching this incorrectly?


Alright, so I grab the value of the field (which will be a couple of
sentences of text), format it and then replace the contents of aims
with it. The question is: what syntax do I need to use to give the
variable's contents a font and a font size before replacing the
current contents of aims? Actually, I wonder whether I could put the
whole table into Excel, format it there and then re-populate...

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 OfficeFrustration.
The comments are property of their posters.