PDA

View Full Version : Solved: Cursor bouncing back to First Page



Shezageek
01-12-2009, 11:36 AM
Hello there,

I have a template that calls a userform. This form is used in order to append documents one after the other and populates formfields as well.
When user is done with the userform, there may be some 20 pages or more.

The problem is as follows:

The cursor is at first formfield in the page 1 of the document.
User may scroll with mouse to page 10 and there needs to input data in one of the formfields.
As soon as I click on the formfield, I am directed back to first page. (although cursor does jump to the relevant formfield) but the screen does not display the selection but the first page.

It is rather annoying. Is it possible to take care of that?

Any help would be highly appreciated.

lucas
01-12-2009, 11:41 AM
The cursor is at first formfield in the page 1 of the document.
User may scroll with mouse to page 10 and there needs to input data in one of the formfields.
As soon as I click on the formfield, I am directed back to first page. (although cursor does jump to the relevant formfield) but the screen does not display the selection but the first page.
This happens after the userform closes? So it has nothing to do with the userform?

can you post a simple example so we don't have to try to figure it out and re-create it?

fumei
01-12-2009, 12:31 PM
Yes please. Or at least try and describe it in more detail.

WHEN is the userform called up? What is the relation of the userform to:

"The cursor is at first formfield in the page 1 of the document.
User may scroll with mouse to page 10 and there needs to input data in one of the formfields.
As soon as I click on the formfield, I am directed back to first page."

I see no connection between a userform and scrolling through the document. Plus, "as soon as I click on the formfield" - do you mean a formfield on page 10? Are you saying if you click into a formfield on page 10, it jumps to a formfield on page 1? I do not understand.

Shezageek
01-12-2009, 12:46 PM
This project is huge. I will try to describe the best I can without uploading 72 supporting documents as well as the initia .dot.

The userform has 32 fields. These fields populate into various documents that are chosen from command buttons and check boxes. The documents that are chosen have other formfields/checkboxes that need to be filled in by the user once the documents are all chosen. It doesn't matter which one you scroll down to whether it is on page 10 or 3, as soon as you click on a formfield or checkbox, the cursor jumps to the first page. You can then scroll down and continue with your formfields normally with no problem. The issue is that the first instance you click on one of these fields, your cursor jumps to the first page.

lucas
01-12-2009, 12:50 PM
You don't have to give us your whole document. Just make a new file and show us what is happening.

Shezageek
01-12-2009, 01:02 PM
Here is a sample doc. You only get one chance to make it happen. Scroll to page 3 and click on any formfield that is not already filled in. You will see that the cursor jumps back to the first page.

Thanks
Sharron

fumei
01-12-2009, 01:04 PM
And please try to answer questions when asked.

WHEN is the userform involved?

We need you to explain carefully.

"These fields populate into various documents that are chosen from command buttons and check boxes. "

Chosen from commandbuttons. Hmmm. Does that mean the userform (whenever it is called, and...hmmmm, from where again???) opens those documents? Or are they already open?

Again, is there any relation between the userform and the cursor jumping issue. there does not seem to be, but then why do you mention it?

If I understand correctly, the userform has nothing to do with anything.

The issue is that ALL documents with formfields jump to page 1 of that document, no matter where you click on a formfield - be it page 10 or page 17.

Is this correct?

fumei
01-12-2009, 01:09 PM
Oh, and I assume the userform is closed when all of this is happening...or is it? Who knows? Is it modal-less and is still alive? Or is it modal and closed? This may, may not, be significant but is hard to say as I do not know what is going on.

How are you moving from document to document? HOW do you have your Section breaks set up? You can have all the formfields you want in a document, but if they are NOT in a protected section...the cursor will not go there.

Just because you have formfields in a document does NOT mean they are actively enterable. They are only enterable IF, and only if, they are in a protected Section.

I suspect this is your situation. In which case, if the formfield you click on is not in a protected Section, then yes, absolutely, the cursor will indeed jump to the first place it can go.

lucas
01-12-2009, 01:10 PM
I unprotected the document and selected the formfield and fill in enabled wasn't checked....

works now.

fumei
01-12-2009, 01:24 PM
Darn, I was just about to point that out.

fumei
01-12-2009, 01:28 PM
Oh, and I have to ask, since I still do not get where any userform fits in...

Do you REALLY, REALLY, need all those formfields?

I very strongly think that you do not. If you are picking up data, especially if it is from a userform, then that data can be placed in a document. Formfields are for direct user entry in the document. If the data is coming from input on a userform, then I would not have all those formfields.

Shezageek
01-12-2009, 01:38 PM
Yes, they are all necessary. I will make sure formfill is enabled.

Thanks
Sharron

Shezageek
01-12-2009, 02:48 PM
My template is setting the protection to form fill. It still does the same thing. It will only do it the first time you click in one of the fields. Any other suggestions? If you have already opened the document and done anything to it, then you will be able to use the formfill. It is only the first time you click on one that it bounces to the first page. Yes, they are ALL protected by the formfill protected section. The userform is the first thing opened from the template. If you open the document, look at your toolbar, you will see a "recall" or "add other documents" button.

This project is huge and very involved. There has been over 500 hours on this project and if I can get this glitch finished, then I will be through with it. I understand if you can't figure it out. I couldn't either and I created it.

S

Shezageek
01-13-2009, 08:36 AM
FYI: I was able to create a work-around for this. Since it only snapped to the first page the first time you accessed a formfield, I wrapped a bookmark around two spaces and called it test. In the final OK button that is to complete the inclusion of all documents, I put the following code:
Private Sub CMDOK4_Click()
Selection.GoTo What:=wdGoToBookmark, Name:="test"
Selection.find.ClearFormatting
Selection.TypeText Text:=" "
frmUserForm4.Hide
End Sub

This actually fixed it. Thanks for your help and suggestions. We can consider this one solved.

S

lucas
01-13-2009, 08:42 AM
Why are you just hiding your userform.....that means it is still open, just hidden.

use unload me instead of frmUserForm4.Hide


I can't help but think you have missed something that has already been pointed out in this thread but you don't provide any examples that reflect your problem so it's nearly impossible to just "imagine" the problem.

lucas
01-13-2009, 08:42 AM
You can mark you thread solved using the thread tools at the top of the page.

Shezageek
01-13-2009, 08:18 PM
The reason the userform is hidden is because it needs to have the ability to recall the form so one can make changes. You can also remove documents simply by unchecking them in the form and adding something else if you wanted to. The userform does exactly what it is supposed to do now. As I said earlier, this project is huge. There are three components that are all intersected and automate 72 documents, a finacial report and a P/L sheet. The only glitch was that it popped to the first page when you clicked in the first formfill. Now that this is resolved, I can put it all on the servers. I appreciate your help.