A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Tabs Button question



 
 
Thread Tools Display Modes
  #1  
Old April 13th, 2008, 10:14 PM posted to microsoft.public.access.forms
Dave
external usenet poster
 
Posts: 218
Default Tabs Button question

Access 2003

I have a TabControl added to a form

on a page (Page3) of that tab control I have added a form

There is also a buttom on the page (but not on the form)

I want that button to add a new record to the form

This is what I have tried but I keep getting an error:

Me!Page3.frmAdminInvestorType.InvestorType.SetFocu s
DoCmd.GoToRecord , , acNewRec

What am I doing wrong?

Dave
  #2  
Old April 13th, 2008, 10:23 PM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Tabs Button question

Dave wrote:
Access 2003

I have a TabControl added to a form

on a page (Page3) of that tab control I have added a form

There is also a buttom on the page (but not on the form)

I want that button to add a new record to the form

This is what I have tried but I keep getting an error:

Me!Page3.frmAdminInvestorType.InvestorType.SetFocu s
DoCmd.GoToRecord , , acNewRec

What am I doing wrong?

Dave


Neither the TabControl nor the TabPage is used to reference the subform.
Just refer to it as you would if there were no TabControl on your form.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #3  
Old April 13th, 2008, 11:00 PM posted to microsoft.public.access.forms
Dave
external usenet poster
 
Posts: 218
Default Tabs Button question

Rick,
Thanks - but I still seem to be having trouble getting focus back on the
subform.

I guess the easiest thing to do would be just put the damn button on the
subform

"Rick Brandt" wrote in message
t...
Dave wrote:
Access 2003

I have a TabControl added to a form

on a page (Page3) of that tab control I have added a form

There is also a buttom on the page (but not on the form)

I want that button to add a new record to the form

This is what I have tried but I keep getting an error:

Me!Page3.frmAdminInvestorType.InvestorType.SetFocu s
DoCmd.GoToRecord , , acNewRec

What am I doing wrong?

Dave


Neither the TabControl nor the TabPage is used to reference the subform.
Just refer to it as you would if there were no TabControl on your form.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

  #4  
Old April 13th, 2008, 11:15 PM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Tabs Button question

Dave wrote:
Rick,
Thanks - but I still seem to be having trouble getting focus back on
the subform.

I guess the easiest thing to do would be just put the damn button on
the subform


Is frmAdminInvestorType the name of the form or the name of the subform
control hosting the form? Often the nmaes are the same, but that is not
guaranteed.

It is also usually the case that you need two lines. One to set focus first
to the subform, followed by a line that sets focus to the desired control on
the subform.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #5  
Old April 13th, 2008, 11:40 PM posted to microsoft.public.access.forms
Dave
external usenet poster
 
Posts: 218
Default Tabs Button question

It is both.

This seems to work but gives me a "Object Required" error

Me!frmAdminInvestorType.SetFocus
DoCmd.GoToRecord , , acNewRec
InvestorType.SetFocus

"Rick Brandt" wrote in message
t...
Dave wrote:
Rick,
Thanks - but I still seem to be having trouble getting focus back on
the subform.

I guess the easiest thing to do would be just put the damn button on
the subform


Is frmAdminInvestorType the name of the form or the name of the subform
control hosting the form? Often the nmaes are the same, but that is not
guaranteed.

It is also usually the case that you need two lines. One to set focus
first to the subform, followed by a line that sets focus to the desired
control on the subform.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

  #6  
Old April 13th, 2008, 11:53 PM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Tabs Button question

Dave wrote:
It is both.

This seems to work but gives me a "Object Required" error

Me!frmAdminInvestorType.SetFocus
DoCmd.GoToRecord , , acNewRec
InvestorType.SetFocus



Me!frmAdminInvestorType.SetFocus
Me!frmAdminInvestorType.InvestorType.SetFocus
DoCmd.GoToRecord , , acNewRec

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #7  
Old April 14th, 2008, 12:53 AM posted to microsoft.public.access.forms
Dave
external usenet poster
 
Posts: 55
Default Tabs Button question

Thanks Rick,

still getting error "Object doesn't support this property or Method"

Dave


"Rick Brandt" wrote in message
t...
Dave wrote:
It is both.

This seems to work but gives me a "Object Required" error

Me!frmAdminInvestorType.SetFocus
DoCmd.GoToRecord , , acNewRec
InvestorType.SetFocus



Me!frmAdminInvestorType.SetFocus
Me!frmAdminInvestorType.InvestorType.SetFocus
DoCmd.GoToRecord , , acNewRec

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #8  
Old April 14th, 2008, 01:04 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Tabs Button question

Dave wrote:
Thanks Rick,

still getting error "Object doesn't support this property or Method"


Which line?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #9  
Old April 14th, 2008, 02:13 AM posted to microsoft.public.access.forms
Dave
external usenet poster
 
Posts: 55
Default Tabs Button question

Well the error did not invoke the "debugger" so I did not know which line.
So I decided just to comment out one line at a time.
To my surprise commenting out this line:
Me!frmAdminInvestorType.InvestorType.SetFocus

eliminated the error
AND
it seems to work

I think I am good now

Thanks much

Dave

"Rick Brandt" wrote in message
t...
Dave wrote:
Thanks Rick,

still getting error "Object doesn't support this property or Method"


Which line?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.