Tab Control Shocker!

G

Guest

I’ve created a table with an associated form which has fields added to it
almost on a daily basis as users see the advantages and would like to add
there own pertinent fields. This means that the form is becoming crowded and
needs re-jigging a bit. I thought that it might be a good idea to insert a
tab control box and break my one page into a number of pages. However, I
find that I can’t simply drag and drop my current form fields on to this tab
control because which ever tab I select all the fields I drag in to it sit on
top of one another rather than sit in the tab I choose. The only way I can
get it to work is to created new field boxes. This takes up time because
they need resizing etc. Am I missing an obvious solution to this or is it
just one of those things.

Any suggestions will be greatly appreciated
 
R

ruralguy via AccessMonster.com

You need to use Cut and Paste rather than Drag and Drop. 1st Cut the control
then select the tab you want and then paste the control onto it.
 
R

Rick Brandt

freelancer said:
I've created a table with an associated form which has fields added
to it almost on a daily basis as users see the advantages and would
like to add there own pertinent fields. This means that the form is
becoming crowded and needs re-jigging a bit. I thought that it might
be a good idea to insert a tab control box and break my one page into
a number of pages. However, I find that I can't simply drag and drop
my current form fields on to this tab control because which ever tab
I select all the fields I drag in to it sit on top of one another
rather than sit in the tab I choose. The only way I can get it to
work is to created new field boxes. This takes up time because they
need resizing etc. Am I missing an obvious solution to this or is it
just one of those things.

Any suggestions will be greatly appreciated

NEW controls can be dragged and dropped onto TabPages. Existing controls must
be cut and pasted.

Select controls then <Ctl-X>
Select desired TabPage then <Ctl-V>
 
S

Stephen Lebans

.. However, I find that I can't simply drag and drop
NEW controls can be dragged and dropped onto TabPages. Existing controls
must be cut and pasted.

Select controls then <Ctl-X>
Select desired TabPage then <Ctl-V>


Thanks Rick. I did not know that new controls could be dragged and dropped
directly onto the control.
 
L

Linq Adams via AccessMonster.com

Another unfortunate fact to be faced, especially considering the fact that
Freelancer is doing this because of the ever growing number of controls
involved, is that all events delineated in code will have to be "re-
connected" after moving the controls to the tabbed pages. If you have
textboxes/comboboxes with AfterUpdate code, you'll have to go to the
Properties box for each control and click on the AfterUpdate property and
select Build Code, then exit the code window. This will "activate" or "re-
connect" the code and the control. Same thing for other events of these
controls, and command buttons, if moved onto the tabbed pages, have to have
their OnClick code re-connected as well.

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

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
L

Linq Adams via AccessMonster.com

Actually, I think I have some code stashed away somewhere that will do the re-
connecting automatically! How many controls are we currently talking about,
Freelancer?

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

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
L

Linq Adams via AccessMonster.com

This routine is based on code originally posted by a gentleman who goes by
the name of ADezii on TheScripts Access Forum:

http://www.thescripts.com/forum/forum142.html

It causes controls that have been moved from a standard form onto pages of a
tabbed page control to be "re-connected" to their underlying code. If you
should try to modify it, in order to include other type of controls/event
procedures, be sure that you only try to re-connect controls to events that
are appropriate! In other words, you can re-connect Command Buttons,
Comboboxes and Labels to their OnClick events, but if you attempt to re-
connect those same three control types to their AfterUpdate events, you will
throw an error, because Labels don’t have AfterUpdate events!

This code will reset some of the more commonly used controls/events.

Private Sub Form_Load()
Dim ctl As Control

For Each ctl In Me.Controls
If (TypeOf ctl Is TextBox) Or (TypeOf ctl Is ComboBox) Or (TypeOf ctl Is
Label) 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
 
J

John W. Vinson

I’ve created a table with an associated form which has fields added to it
almost on a daily basis as users see the advantages and would like to add
there own pertinent fields.

STOP! Step away from the computer, keep your hands in sight!

<the Normalization Police car is right behind you, lights flashing>

<g>

Seriously, this is almost certainly an indication that you're "committing
spreadsheet". What kinds of fields are being added here? It's very rarely
necessary (in a properly designed table) to add new *attributes* of the Entity
that the table represents. I suspect you're actually storing *data* in these
fieldnames, and that you should consider modeling this data as a many to many
relationship instead (or perhaps several).

Post the names of a few of these fields... you may have a much better
alternative than continually tweaking your form.


John W. Vinson [MVP]
 
L

Linq Adams via AccessMonster.com

Actually, the first thing I thought of when reading this thread was your
quote about "committing spreadsheet by Access," which I do cite on a fairly
regular basis! But, over the years, I've gotten an ever growing callus on my
forehead from beating it against the wall because of trying to deal with
people who think "normalization" has to do with our relationships with Russia
and China! These days, unless they sound like they're exceptionally open to
suggestions of substance as well as style, I usually, sad to say, just stick
with the mechanics of the posed question/problem.

Having said that, I believe in moderation in all things, including moderation,
but a table with more than 25-35 fields has to be looked at closely! And a
table that's expanding like the US national debt really does need to be shot!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top