Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is It Possible To Use A DB To Store Font Names?

Status
Not open for further replies.

MrVB50au

Programmer
Mar 16, 2003
326
AU
I had recently been using a combo box to gather 'FontNames' from my computer. Just as I added an extra 500 new fonts to the list I found it's not getting all the font names.

Do think it's possible to securely load Font Names into a database and then load the list from the database into a combo box?

Here's My Scenaria:
------------------------------------------------------------
Dim i As Integer
'Only needs to be done once unless user adds more fonts.
For i = 0 to Screen.FontCount - 1
datFontNames.Recordset.AddNew
datFontNames.Recordset.Fields("Fonts") = Screen.Fonts(i)
Next i
------------------------------------------------------------
When the application loads, is it possible that the following would work and securely be loaded into the combo box?
------------------------------------------------------------
Private Sub Form_Load()
With datFontNames
.Recordset.MoveFirst
While Not .EOF
cmbFontName.AddItem .Recordset.Fields("Fonts")
.Recordset.MoveNext
Wend
End With
End Sub
------------------------------------------------------------

Any suggestion would be greatly appreciated.

Thanks again,

Andrew.
 
Re the database, yes it will work, but you need to add a ".Update" method before the "Next i" in the first Sub.

However you say "I had recently been using a combo box to gather 'FontNames' from my computer. Just as I added an extra 500 new fonts to the list I found it's not getting all the font names."

The question is why are you not getting all the font names. Can you post your code please.

"Life is full of learning, and then there is wisdom"
 
it's ok now I have worked it out and it seems to be working ok for now [cross fingers and toes].

Will let you know how it goes.

Thanks again,

Andrew.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top