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  

Moved Form Data to Tab Control



 
 
Thread Tools Display Modes
  #1  
Old November 17th, 2009, 08:09 PM posted to microsoft.public.access.forms
scott04
external usenet poster
 
Posts: 197
Default Moved Form Data to Tab Control

Hi All,

I recently moved all of my form fields to a tabbed control. The reason i
did this was to utilize a subform. My main problem now is that none of my
code is working on the form now. Can some explain why none of the old code
works now and how i can go about getting it to work. Thanks
  #2  
Old November 17th, 2009, 11:17 PM posted to microsoft.public.access.forms
Kc-Mass
external usenet poster
 
Posts: 362
Default Moved Form Data to Tab Control

You've likely made your form into a subform. Let's say your tab control is
housed on frmTab, your old form was frmMyForm. Your old code likely
referenced a control on your old form as Forms!frmMyform!MyControl. To
reference that control now you have to use Forms!frmTab!frmMyform!MyControl.

Regards

Kevin


"scott04" wrote in message
...
Hi All,

I recently moved all of my form fields to a tabbed control. The reason i
did this was to utilize a subform. My main problem now is that none of my
code is working on the form now. Can some explain why none of the old
code
works now and how i can go about getting it to work. Thanks



  #3  
Old November 18th, 2009, 12:39 AM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Moved Form Data to Tab Control

If the controls in question were simply moved from the form's Detail Section
directly to a page of the tabbed control, you need to "reconnect" the
controls and their event codes.

Courtesy of ADezii at Bytes.com, this code will "reconnect" controls to some
selected Events (OnClick and AfterUpdate in this example.) It can be modified
for other Events, and has the advantage of updating a large number of
controls without doing them one by one.

Private Sub Form_Load()
Dim ctl As Control

For Each ctl In Me.Controls
If (TypeOf ctl Is TextBox) Or (TypeOf ctl Is ComboBox) Then
If ctl.OnClick = "" Then
ctl.OnClick = "[Event Procedure]"
End If
End If
Next

For Each ctl In Me.Controls
If (TypeOf ctl Is TextBox) Or (TypeOf ctl Is ComboBox) Then
If ctl.AfterUpdate = "" Then
ctl.AfterUpdate = "[Event Procedure]"
End If
End If
Next
End Sub

Alternatively, in Design View, you can select a control, go into Properties -
Events and click on the event in question, to take you to the code window, as
if you were setting it up for the first time. Once in the code window, simply
return to Design View. The control is now "connected" to its code and the
hotkey will work. The disadvantage to this is that it's time consuming if it
involves a lot of controls.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

  #4  
Old November 18th, 2009, 05:18 PM posted to microsoft.public.access.forms
scott04
external usenet poster
 
Posts: 197
Default Moved Form Data to Tab Control

Thank you for that information...i simply strarted from scratch with the
form...created the tabs and then migrated my code...now everything seems to
work...thank you

"kc-mass" wrote:

You've likely made your form into a subform. Let's say your tab control is
housed on frmTab, your old form was frmMyForm. Your old code likely
referenced a control on your old form as Forms!frmMyform!MyControl. To
reference that control now you have to use Forms!frmTab!frmMyform!MyControl.

Regards

Kevin


"scott04" wrote in message
...
Hi All,

I recently moved all of my form fields to a tabbed control. The reason i
did this was to utilize a subform. My main problem now is that none of my
code is working on the form now. Can some explain why none of the old
code
works now and how i can go about getting it to work. Thanks



.

 




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 06:31 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.