Error Switching to Datasheet View

RodShinall

Registered User.
Local time
Today, 03:31
Joined
Dec 21, 2006
Messages
32
I am experiencing an error message in an Address Book application I am working on. This
application stores names, addresses, phone numbers etc. It also stores URL's to websites. On my form I have arranged my text boxes columnar style allowing me to tab down the page in a logical order to enter data. In records that contain street addresses and phone numbers I display all the appropriate text boxes with their labels. In records that contain only a name and a website URL I hide all unused controls and reposition the website and two other text boxes higher on the form to avoid tabbing through unused text boxes. I accomplish this using the form's OnCurrent event and VBA code specifying the Top and Visible properties of the controls I want to hide or reposition. This all works perfectly as far as the form is concerned. However, at times I like to view my data in datasheet view and when I try to switch to datasheet view I get this error: Runtime error
'2100' The control or subform is too large for this location. When I click debug, the code window opens highlighting the line of code specifying the Top property of the text box. This also occurs in a couple of other applications that I have developed where I have used the OnCurrent event to change the Top property of several controls. I can't figure out why switching to datasheet view triggers this error since the form works perfectly. Can anyone tell me why this is happening and f there is a fix? I am using Access 2003. Thank you.
 
As you've found out, using DataSheet View severely limits the kind of formatting that you can do; you have virtually no control over how the form is laid out. Any positioning of controls you do in Design View (including their Top Property) are, in essence, ignored by Access when it displays the form in DataSheet View. Unbound controls, including command buttons, are simply ignored. You can do some simple formatting thru Conditional Formatting, but not thru code. As you've found out, trying to dynamically change the position of a control thru code in DataSheet View causes an error.

I think you're just going to have to create a separate form form to view your data in DataSheet View, which is easily done using the Forms Wizard.
 
Thank You, Missinglinq. I did not realize that Data Sheet View was actually considered a form. I thought it was merely the table data displayed in a spreadsheet like format. Thanks for pointing that out and I will take the approach you suggested.
 

Users who are viewing this thread

Back
Top Bottom