Connecting Tech Pros Worldwide Forums | Help | Site Map

Can a tab be created in form when a record is created or query is run?

Newbie
 
Join Date: Sep 2009
Posts: 23
#1: Oct 8 '09
Hello,

This is a design question not a "how to" I would like know if it can be done before searching for a non existant answer :).

If a record is created via a form, can a tab be created on another form from that record creation?

I.e. user creates record 286 (arbitrary number) via FormRecordEntry. Is it possible that a tab be created at that time on FormLog for that record?

I am thinking if that can be done, then I can create an OnClick event for the tab to query TableRecords for all subdata that relates to record 286.

If it is doable, I'll go searching for the how-to.

Regards,
Expert
 
Join Date: Jul 2008
Location: Maryland
Posts: 1,164
#2: Oct 8 '09

re: Can a tab be created in form when a record is created or query is run?


I haven't really explored whether this is possible, but I would doubt it could be done outside of design mode. I think it might be easier, though, to have a continuous form with a record selector, and a linked subform with details. When a record is added, it will show up in the continuous form, where it can be selected to view details. On the other hand, I'm not sure of any way to make the records list horizontally, if that's what your application requires.
Newbie
 
Join Date: Sep 2009
Posts: 23
#3: Oct 8 '09

re: Can a tab be created in form when a record is created or query is run?


Okies, ChipR.

I see where that would also take care of it.
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,715
#4: Oct 8 '09

re: Can a tab be created in form when a record is created or query is run?


I can't see how it would make sense to design a page (Tab) that relates to a specific record. Surely the page would relate to a particular record source. Assuming that to be the case then the form on that page could be requeried or its filter could be reset. These would give what you require without design changes. I'm assuming your requirements are for what I'm thinking. Otherwise your question doesn't make sense to me. Maybe I'm missing something.
ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,214
#5: Oct 9 '09

re: Can a tab be created in form when a record is created or query is run?


Quote:

Originally Posted by Rotorian View Post

Hello,

This is a design question not a "how to" I would like know if it can be done before searching for a non existant answer :).

If a record is created via a form, can a tab be created on another form from that record creation?

I.e. user creates record 286 (arbitrary number) via FormRecordEntry. Is it possible that a tab be created at that time on FormLog for that record?

I am thinking if that can be done, then I can create an OnClick event for the tab to query TableRecords for all subdata that relates to record 286.

If it is doable, I'll go searching for the how-to.

Regards,

I too like NeoPa am slightly lost, but I'll nonetheless show you how to dynamically add another Tab (Page) to a Tab Control named TabCtl1 on frmTabTest and give it the Caption of 'Last Tab Added':
Expand|Select|Wrap|Line Numbers
  1. Dim frm As Form
  2. Dim tbc As TabControl
  3.  
  4. DoCmd.OpenForm "frmTabTest", acDesign
  5.  
  6. Set frm = Forms!frmTabTest
  7. Set tbc = frm!TabCtl1
  8.  
  9. tbc.Pages.Add
  10.  
  11. tbc.Pages(tbc.Pages.Count - 1).Caption = "Last Tab Added"
  12.  
  13. DoCmd.OpenForm "frmTabTest", acNormal
  14.  
Reply