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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Debug a Scroll Bar in SubForm

Status
Not open for further replies.

PaulaJ

Programmer
Jun 20, 2000
130
US
I have an entry form with a display only subform both having the same Record Source. The fields on the main form are Unbound and loaded with VBA Statements in the LOAD from the calling form.

It appears to load perfectly and functions correctly until I click on the scrollbar when there are too many record for the screen. Then it appears to load the most recent record into the unbound fields.

I have tried putting debug statements into every possible function on the form, and forced a module into the LOAD on the subform. However, when I click on the scrollbar, it doesn't go to debug, but the Unbound fields change.

What actually happens when a ScrollBar is clicked?
 
Oops, I lied. The fields in the main form are bound. Can I use a subform and a form over the same table/query? My original purpose in setting this form up this way, was to allow viewing but not changing of previous records, and still allow entry of new records on the same screen. Scrolling to the end of a subform to enter a new record seemed awkward. Any suggestions?
 
I added a command key to add a record, now when I click on the scrollbar, I still get the last record moved into the Main Form. When I click on the add record, the Key Field on the Main Form gets cleared and the subform goes away entirely. I still think it's related to using the same query for the Main Form and the Sub-Form, but don't know how to find out which events fire when I click on the Subform to put in some code to fix it.
 
My original purpose in setting this form up this way, was to allow viewing but not changing of previous records, and still allow entry of new records on the same screen.

Assuming the above, why don't you try this,

Dump the subform, set the following properties on the main form.

allow edits = N
deletions = N
Additions = Y
data entry = N

Ron
 
That would be my "if all else fails" plan. I would really like to be able to view the last 3 or 4 previous records at the same time, hence the subform. It's a comments/notes field, so a lot of the time there won't be any new records. Appreciate the quick response though, it does give me a new idea. Maybe I'll add the "Add New Note" to the Previous Form and then have the subform be the only thing displayed on an additional command key of "Display Comments". More than one way to skin a cat. Thanks, PaulaJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top