A Little Help With Tab Control (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 09:02
Joined
Jan 14, 2017
Messages
18,209
Paul (Gasman)

I just trued running this in 2007 using a VM but get the same error message as you. As I've not contributed in any meaningful sense to this thread, I'm unable to explain what the issue is or whose code is preventing it working in 2007

Similarly I'm not best placed to answer your other questions.
Hopefully Mark will be able to advise
 

MarkK

bit cruncher
Local time
Today, 01:02
Joined
Mar 17, 2004
Messages
8,179
Gasman, you can just delete that whole module. I deleted it and the rest of the project compiles just fine. See if that solves it.

I have a question though. This is all to speed up the loading of frm_home I believe.?
For me it's not just speed, it's also simplicity. One tab control. One subform control. Each click on a tab page changes out a single subform.

I do appreciate that the tab header and one subform control would be a better option though as along as one did not need to refer to any of the controls on the other tabs?
I would never design a system where one subform depends on the presence of another subform. That is just too tenuous a relationship for me, too fragile. I want objects to be able to solve their own problems without having to follow tenuous hardcoded object references like ...
Code:
Forms!SharedMainForm.OtherSubformControl.Form.SomeControl = Me.SomeValue
hth
Mark
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:02
Joined
Sep 21, 2011
Messages
14,232
MarkK,

I never even tried to compile the DB.
I deleted that module and then tried, but it balked at Dim appOutlook as Outlook.Application.
It was looking for V14, so I removed that as I have V12.
Added Excel references, but it still balked.

I use Outlook.Application in my DBs with no problem.?

Anyway I changed the declaration to object and it did finally compile.

However after logging in with User2, I still get the same error message?

Not to worry, as I have mentioned, I have basic idea on how to implement and yes I agree, best not to have one tab dependent on another.
 

isladogs

MVP / VIP
Local time
Today, 09:02
Joined
Jan 14, 2017
Messages
18,209
MarkK,

I never even tried to compile the DB.
I deleted that module and then tried, but it balked at Dim appOutlook as Outlook.Application.
It was looking for V14, so I removed that as I have V12.
Added Excel references, but it still balked.

I use Outlook.Application in my DBs with no problem.?

Anyway I changed the declaration to object and it did finally compile.

However after logging in with User2, I still get the same error message?

Not to worry, as I have mentioned, I have basic idea on how to implement and yes I agree, best not to have one tab dependent on another.

Just change both Outlook and Excel refs to v12.

However using my 2007 VM, I also tried removing the module ModHideClose and all code from frmHome. No luck.

OK I thought lets create a new form and copy across the controls from frmHome. Nope - can't go into design mode unless I use 2010 or above.
In 2010, I can't see anything special about the design
Sorry - I've run out of ideas to try & help you
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:02
Joined
Sep 21, 2011
Messages
14,232
Colin,

Thanks for confirming. I did change refs to V12 as I mentioned, but for some strange reason it did not like Outlook.Application, yet I use that no problem in my DBs as well.

Please don't spend any more time on this. It is just one of those Access things. If you recall I've hand strange errors in 2007 which work fine in later versions for code that you've created, yet nothing looks special about the code being non 2007.?

I now know how to implement this functionality in the future, should I get the same problem, and that was my intent on asking the questions in this thread.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:02
Joined
Jul 9, 2003
Messages
16,271
Some Errors are very hard to track down. I recall deploying a runtime version of MS Access on a Citrix system with an MS SQL back end. It worked fine on my own PC but just would not work properly on the clients system, it just kept crashing... The problem with runtime is it doesn't tell you anything! I had to go through every single code block and make sure it had error code, if it didn't, add it. It was a nightmare.

Now I routinely use the text insert ability of MS Access to place a code function stub in my code with all the error code already in it. Very seldom do I write code stubs without error handling. Once bitten twice shy!

If this problem does niggle at you and you decide to tackle it to find out what's going wrong, one thing I find very effective is to create a brand new blank database, but "NO" don't import anything from the old database, not objects, not forms, nothing like that. Tables are probably ok! (As in - famous last words) --

In this new database, create very simple versions of the forms from your original database, just a bare minimum of controls to test the functionality.. Now copy and paste the text version of the code, subroutines, functions and things from the original database. Obviously this is not something you would want to do often, so try compiling and decompiling repairing and everything else you can think of first!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:02
Joined
Aug 30, 2003
Messages
36,124
Now I routinely use the text insert ability of MS Access to place a code function stub in my code with all the error code already in it.

I love MZ Tools for the ability to add customizable error handling to a sub and code templates. They are all a right-click away while coding.
 

psyc0tic1

Access Moron
Local time
Today, 03:02
Joined
Jul 10, 2017
Messages
360
I removed the source object for the first tab and this code works:

Code:
        Case "NewRecordInputForm"
            Me.Patrick_Input_Form.SourceObject = "frm_engineerinput"

You'd have to do the same thing for the other tabs.

I tried this first and yes it did work but has not sped up the loading time of the database.
 

psyc0tic1

Access Moron
Local time
Today, 03:02
Joined
Jul 10, 2017
Messages
360
Here's the single subform control idea implemented. Tab_Change() event swaps out the subforms. Looks like a tab control, smells like a tab control, but there is nothing on any of the pages.
Hope this helps. If not, just ignore it. :D
Mark

I tried this method next and this is pretty cool but alas... this has not sped up the loading time... well... it sped up the time it takes the database to load after logging in but it has lengthened the time it takes each form to open after that... 3 or 4 times longer than before.

At the same time the forms functionality slowed down... like when entering data... after you type the first character everything freezes for 5-10 seconds.
 

psyc0tic1

Access Moron
Local time
Today, 03:02
Joined
Jul 10, 2017
Messages
360
No Mark, I was not even trying to log in. I opened it with the shift key and looked at some code to see what the form was called.

Logging in, it balks at ptrsafe in ModHideClose and I'm on 32 bit windows.

Thank you.

@Ridders I can open every form in design view except frm_home.
Seems it was 64 bit code?

Gasman,

If you comment out the HideAccessCloseButton on the second line of the code behind frm_home it will stop doing that to you when you open it. The mod_HideClose module should be the only one in the db that has ptrsafe code in it.

If I knew what to put in... it can be made to work with both.
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:02
Joined
Sep 21, 2011
Messages
14,232
That is the problem, I cannot open that form, that is the only form I cannot open, even in design mode.

Don't worry about it, I know how it should be done now, which is all I was looking for.

Gasman,

If you comment out the HideAccessCloseButton on the second line of the code behind frm_home it will stop doing that to you when you open it. The mod_HideClose module should be the only one in the db that has ptrsafe code in it.

If I knew what to put in... it can be made to work with both.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 04:02
Joined
Apr 27, 2015
Messages
6,321
I had to read this post in it’s entirety...needed to find out WHY a somewhat simple subject required 110 posts with some of the best that AWF has to offer involved!
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:02
Joined
Sep 21, 2011
Messages
14,232
I had to read this post in it’s entirety...needed to find out WHY a somewhat simple subject required 110 posts with some of the best that AWF has to offer involved!

Sorry, I muddied the waters somewhat. :)
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 04:02
Joined
Apr 27, 2015
Messages
6,321
Somebody’s got to do it! And, there were some cool things to learn too...
 

psyc0tic1

Access Moron
Local time
Today, 03:02
Joined
Jul 10, 2017
Messages
360
That is the problem, I cannot open that form, that is the only form I cannot open, even in design mode.

Don't worry about it, I know how it should be done now, which is all I was looking for.

Yea... when that happens... holding down the SHIFT key and clicking on the db will open it with no code running... then ALT+F11 will bring up the code window so the line can be commented out. I'm sure this isn't news to you though... you guys are great.
 

psyc0tic1

Access Moron
Local time
Today, 03:02
Joined
Jul 10, 2017
Messages
360
I had to read this post in it’s entirety...needed to find out WHY a somewhat simple subject required 110 posts with some of the best that AWF has to offer involved!

Mostly my fault.

The thread started out in one direction and once some areas were figured out... I went deeper into other directions.

Probably should have started new threads for the different issues.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 04:02
Joined
Apr 27, 2015
Messages
6,321
To be clear, there was absolutely NO stone-thowing on my part. And threads tend to take a few turns here and there...there were at least three Mods involved so it there was a need for a new one, one of them would have sorted it out.

Glad you were able to get answers to some of your questions...
 

isladogs

MVP / VIP
Local time
Today, 09:02
Joined
Jan 14, 2017
Messages
18,209
@MarkK
This is a further thank you for the idea you suggested back in post 89 of this thread

I tried to add some well deserved RPs to you but it says I need to spread them around some more before I can give you any more!

Its taken me nearly a month to get around to it but I've now implemented the idea as part of an updated version of my JSON Analyse & Transform app.

The basic idea is:
a) JSON files are imported, analysed into the component parts & transformed creating one or more linked tables 'on the fly'
b) To view the data, a form is automatically created in datasheet view (using a template form) for each table .... with subforms added as appropriate where there are linked tables. This creates a series of subdatasheets so all the data can easily be made visible.
The top level form is then used as the source object for an empty subform (this was the idea I was stuck on until I nicked it from you)

So using a relatively simple example, we start by importing something like this:



then analyse it:



then using a transform function to populate the tables created, we can view the data using linked subforms like this:



I realise this approach disobeys loads of recommended Access procedures by creating tables & forms 'on demand' but its exactly what is needed for this unusual Access app which is intended solely for developers

I will explain the idea in more detail in a separate thread in the next day or so
Thanks again
 

Attachments

  • JSONImport.PNG
    JSONImport.PNG
    66.6 KB · Views: 262
  • JSONAnalyse.PNG
    JSONAnalyse.PNG
    37.4 KB · Views: 261
  • JSONOutput2.PNG
    JSONOutput2.PNG
    51 KB · Views: 264

Users who are viewing this thread

Top Bottom