By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

some Subform doesnt display properly when setfocus is activate

P: 4
Hi

I have a main form with 7 subforms where the master/child link is the RefID in the main form where the Main form is 1-many relationship to those subforms. All the subform have the same properties

I have setfocus on the last field on the each of the subform to move to the first field of the next subform when using Tab.

The problems only occurs when I create a new records. One of the subform doesn't display properly on the form, such as it shift down or become invisible. The other subforms works fine.

Does anyone have this problem before? why all the subforms have the same properties but one doesn't display properly.

I am desperate to solve this problems, could anyone please shed some light on this problem.

Thank you very much for your time.
Hong
Apr 28 '07 #1
Share this Question
Share on Google+
7 Replies


nico5038
Expert 2.5K+
P: 3,072
I assume you're working with subforms in "Continuous" mode.
In such a case make sure that the length of the subform (the light gray area when in designmode) does fit the area displayed.
As you've noticed, Access forces the active control to be displayed and when it's the last (lowest) you can be in trouble.

Nic;o)
Apr 29 '07 #2

P: 4
Hi Nic

Thanks for replying. All of my forms is single form. I have resize the Details are in the design view to minimal. I don't understand how to change the length of the Gray area you mentioned.

And what do you mean "when it's the last (lowest)?

Could you please shed some more light to this gray area?

Thanks
Hong

I assume you're working with subforms in "Continuous" mode.
In such a case make sure that the length of the subform (the light gray area when in designmode) does fit the area displayed.
As you've noticed, Access forces the active control to be displayed and when it's the last (lowest) you can be in trouble.

Nic;o)
Apr 30 '07 #3

nico5038
Expert 2.5K+
P: 3,072
Just open the subform in design mode.
Now scroll to the bottom and see that the backgroud has a different (darker) color at the bottom. The separation line between the dark and light can be "lifted".
I always use that on the bottom and righthand side. Access will stop making the area smaller when it finds controls, so you can even "lift" the bottom line to the top ruler and nothing bad will happen :-)

Nic;o)
Apr 30 '07 #4

P: 4
Hi Nic

There is a grey area with the line and I have move it all up and there is no where that I can lift up at all.

I use the below code on on exit of the last field of every subform to move to the first field of the next subform which cause this display problems.

Private Sub Corporate_Objectives_Exit(Cancel As Integer)
Me.Parent.SetFocus
On Error Resume Next
Me.Parent.RSF017_BranchObjectives.SetFocus
Me.Parent.RSF017_BranchObjectives.Form.Branch_Obje ctives.SetFocus
On Error GoTo 0
End Sub

Is there another way to fix it?

Many thanks and have a nice day.
May 2 '07 #5

nico5038
Expert 2.5K+
P: 3,072
Hmm, only the last setfocus should do the trick, but I see an odd space in the fieldname:
Me.Parent.RSF017_BranchObjectives.Form.Branch_Obje ctives.SetFocus
sure it doesn't need to be:
Me.Parent.RSF017_BranchObjectives.Form.Branch_Obje ctives.SetFocus

Nic;o)
May 2 '07 #6

P: 4
Hi Nic

That "odd space" is just a display error on this page only, there isn't any space on the actual code.
May 3 '07 #7

nico5038
Expert 2.5K+
P: 3,072
Hmm, the behaviour puzzles me, but as I can't reproduce it, detection/curing is hard.

Did you check under the datatab of the subform's or all "Allow ..." properties are identical and that the trouble one doesn't use "Dataentry" ?

Nic;o)
May 4 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.