default tab control???

Jane

New member
Local time
Today, 10:57
Joined
May 7, 2001
Messages
6
My form has 4 tab controls.
How do I instruct the form to automatically go back to the first tab control each time I go to a new record?
 
In the OnCurrent event, you could set focus to Page1.
me.pagename.setfocus

You can find the page name for the tab on the "other" tab of the propery window.
 
ok, thanks, I did this but when I went to form view I got a message saying cannot find macro 'page1' how do I set this macro?
 
I'm sorry, I'm lost, do I use that code to create the macro? do I replace part of that code with the name of my control tab? The name of my control tab is COMMENTS. I have no idea what I'm doing when it comes to macros. Thanks for your help!
 
OK, I think this will work:

- In deisgn view, select View/View Code

- At the top left of the code window, select Form from the drop-down list

-(It will create a bit of code for Form_load - ignore this).

-In the right-hand drop down list, select Current.

-It will have created a bit of code that says:
Private Sub Form_Current()

-Immediately after this line, but before the End Sub line, paste in this code:
Me.COMMENTS.Value = 0

-Click the save icon and close the code window.

That should do it (I think)
 
I tried this code and it worked, except that when I first open the form, it gives this message:

"can't find the macro '.'
The macro (or its macro group) doesn't exist, or the macro is new but hasn't been saved. Note that when you enter the macrogroupname.macroname syntax in an argument, you must specify the name the macro's macro group was last saved under."

How can I get rid of this message?
Thanks for any help.
 
On the property sheet on the form current line put [EventProcedure] click on the box with three dots beside it and put the code in between these lines
Private Sub Form_Current()

End Sub
Should end up as

Private Sub Form_Current()
Comments.SetFocus
End Sub
Click on the debug button on the toolbar, select compile and save all modules, close the window, open the form.
 

Users who are viewing this thread

Back
Top Bottom