Error 2101

J

JamesJ

I'm calling the following function from On Current of my
Access 2007 sp2 Split Forms seeing that changing these datasheet
properties in Access Options only is valid for new datasheets:

Public Function DataSheetProperties(frm As Form)

frm.DatasheetFontName = "Calibri"
frm.DatasheetFontHeight = "10"
frm.DatasheetFontWeight = "500"
frm.DatasheetForeColor = RGB(0, 0, 0)

frm.DatasheetBackColor = RGB(255, 255, 255)
frm.DatasheetAlternateBackColor = RGB(121, 167, 227)

End Function

And I'm getting the following error on
frm.DatasheetForeColor = RGB(0, 0, 0):

Error 2101

'The setting you entered isn't valid for this property'

This code is working ok in another backup db from a while back where I
abandoned the split forms for continuous forms.
Only difference is in the one that works ok the datasheet is on the bottom.
The one where it isn't working the datasheet is on the left.
Originally I was changing my forms from continuous to split and placing the
datasheet on the left. The code wasn't
in the current db so I copied and pasted it.from the one that works. I
immediately started getting the error.on the first 4 forms I had changed. I
then abandoned that db and started simply changing the datasheet from the
bottom to
the left on the one that works. Now I'm only getting the error on 1 form
that wasn't in the split form db but as soon
I started calling the function I started getting the error.
The error occurs in the On Load also.

Placing 'On Error Resume' suppresses the error and the form opens ok. But, I
don't care for the idea that something doesn't seem right.

I hope I explained it properly. I don't understand what I wrote myself.

Any help will be appreciated,
James
 
J

JamesJ

These splitform datasheet properties are available.
I call the function form the On Load now and and able to change font names,
backcolor, alternate backsolor.....
Isn't the code I pasted into my post code example? Although very crude.
And now by putting in the On Error Resume Next the error doesn't trigger.

James
 
J

JamesJ

The only reason I 'saw' these properties at all was the 'Auto List' members
popping up.

James
 

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

DataSheetForeColor 5
Setting DataSheet Font 2
Excel VBA 1
Excel Applying Code to a Column 0
Error '2101' Invalid Setting for Me.Dirty 2
Error 2101 3
conditional formatting vba code for a split/datasheet form? 2
Global Function 2

Top