Setting DataSheet Font

J

JamesJ

In Access 2007 I'm attempting to set the Datasheet font for my
split forms by calling the following from the OnOpen of my form(s)
but nothing happens. (No error Message):

Public Function DataSheetFont()

Set frm = Screen.ActiveForm

frm.DatasheetFontName = "Broadway"
frm.DatasheetFontHeight = "10"

End Function

But when I use this as a form function it works:

Private Sub Form_Open(Cancel As Integer)

Me.DatasheetFontName = "Century Gothic"
Me.DatasheetFontHeight = "10"

End Sub

I'd like to call the Public Function in the OnOpen of the form so I don't
need to change it each form.

Any help will be appreciated,
James
 
D

Damon Heron

Call the function from your form open event like this:

Call DataSheetFont(Me)

Public Function DataSheetFont(frm As Form)
frm.DatasheetFontName = "Broadway"
frm.DatasheetFontHeight = "10"
End Function
 
J

JamesJ

That was it!

Thanks much,
James

Damon Heron said:
Call the function from your form open event like this:

Call DataSheetFont(Me)

Public Function DataSheetFont(frm As Form)
frm.DatasheetFontName = "Broadway"
frm.DatasheetFontHeight = "10"
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Global Function 2
DataSheetForeColor 5
Error 2101 5
Keep form open until loop completes 2
vbYesNoCancel 14
Create a SubForm on a Tab Control 0
Datasheet Font 5
commandbutton does not answer 0

Top