Defining Variables (1 Viewer)

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:00
Joined
Feb 19, 2002
Messages
43,257
If you need to lay the buttons over different places on each form, that is a situation that is more complex but which can still be solved with a single form. If the buttons are always in the same place and always mean the same thing, that is a problem that should be solved with a SINGLE form.

Which is it? We are 61 posts into this question and we still don't have a clear definition of your requirements.
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
If you need to lay the buttons over different places on each form, that is a situation that is more complex but which can still be solved with a single form. If the buttons are always in the same place and always mean the same thing, that is a problem that should be solved with a SINGLE form.

Which is it? We are 61 posts into this question and we still don't have a clear definition of your requirements.
Complex one need to lay the buttons over different places on each form.
 

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
So while I'm waiting for my android box to update, I have to wonder why
- there isn't a single form (or a set of base forms if for some reason they are so different - e.g. some require tab controls - maybe)
-
an image control is told what picture to load based on user demand (ud)
- ud therefore shows whichever buttons the table data determines and places them accordingly
- table data also provides one or more string parameters associated with each button to a function that controls what happens next. Perhaps the table data assigns a button Tag property value instead but who knows.

After 4 pages of responses I can't help but think that a course of action should have been arrived at quite some time ago. Maybe it's because the information has been coming in dribs and drabs, but if there was a complete explanation of the process at any point, it's buried in history and it seems it has been overlooked as the same questions and points continue to be asked/made.

Maybe what's needed is a sample db along with a couple of process pic files, some notes (or whatever it is that is supposed to appear on a few button clicks) along with anything else that's needed to set up maybe one form with 2 process examples and work out how to drive the process(es). Then OP would replicate.
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
I've put in a couple other questions in the test db if someone could answer. Remember this is just a quick test db so it can give you an idea of what would be the problem with just having one form (Relationships are a mess not at all like I have them). Thanks for the help.
 

Attachments

  • Test!.accdb
    1.4 MB · Views: 94
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:00
Joined
Feb 19, 2002
Messages
43,257
The way I would handle this to use a single form:
1. Create a bound control to hold the picture as the background for the form.
2. Create a grid of textbox controls to cover the whole form. They all will default to visible = false. I'm using textboxes because there will be a very large number of them and they are "lighter" in weight than the combo box is.
3. Create a table that maps the machine to the grid number and function for the "button"
4. When the form is opened, load the picture and then read the mapping table and set up the textboxes that will be used for this machine.

Does that give you some idea of how to start. It might take a couple of days to get this form put together correctly but it beats the hell out of changing 300+ forms plus having to create new ones for new machines.
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
Sounds like a good idea but what about the note flag there might be lots of them as well.... I guess you could pick out one of the existing ones mapped out. Then the question of the size if I go too small or big with the text boxes. Great idea but its above my skill level to get this to work. Any ideas on the splash screen or search form? Thanks again for reviewing the db and the ideas...
 

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
At first glance I'd say don't expect an example real soon. It's all macros, which will have to be replaced with code if anyone here were to provide an example. As for your questions, I'll try to review them and post back with answers if possible.
 

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
Some side notes - all meant in the spirit of education, not criticism:

ID is a meaningless name for a field. GraphicID would be far better for a table named tblGraphic

NoteID PK should be autonumber, not number, and AutoNumberID is of no use - unless maybe you're using it for some sort of numbering scheme. However, I don't see why notes would need any sort of serialization scheme.

Ditto for tblEquipment

Following these suggestions would give you GraphicID in 2 tables, which is why it's usually better to identify at least which is the FK field: GraphicID and GraphicID_fk or GraphicID_pk and GraphicID_fk (or drop the underscores)

Whatever BasPoint is, I kinda doubt it has a phone number, in which case it's not an attribute of the entity and doesn't belong there. Since EnteredBy is short text, that means you must be using real data as foreign key values - or what should be fk values (OK, really just values since you don't have a parent/primary table) which means you need a personnel table. If Jane Smith gets married and her last name becomes Brown, should you have to update every such field in every record in every table that uses it, or just in some personnel table in one record?

There is no pk in tblBuildings. I'd consider that to be a shortcoming that WILL bite you one day.
That's all for tonight as it's after 11 PM. Will see if I can work on your search question tomorrow. I figure that these functional issues might as well be looked at first as it's likely that record source design would have to change to some degree, and it suits my currently short available time slots right now.
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
Sorry I think I wasn't clear enough I don't need help with the relationship part of the database this is a just a test db (old test db a complete mess to lazy to fix the relationship part before sending it out). MajP helped me with this a long time ago and I have it perfect not like it is in the sample test db at all. I just need help with the splash screen and the equipment form search and to show you the idea. Thanks again for the help and all your ideas were great.
 
Last edited:

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
Gotcha. I think splash is ok now. On my phone and company coming so nothing else I can do until tonight at the earliest.
 

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
Didn't get to look until after 10 PM but here's what I've got for you thus far: You asked
If I click on search with an empty text box(Text35) it will bring up all the records in the query. I would like the search to show the records only for a single Bldg AFC or BBB when I do this and not see the records from the other buildings. How could I do this to prevent having to make multiple queries and forms and filter this way? I also don't want the user to have to filter themselves with the search button for the building.

Maybe I don't understand the last sentence. You want to search for one building but you don't want to have to use a button? Then change the textbox to a combo
- row source: SELECT DISTINCT BldgAbb, BuildingName FROM tblBuildings;
- width .75"; list width 2.25"; 2 columns: 0.75" and 1.5" wide
- AfterUpdate event:
Me.Filter = "BldgAbb = '" & Me.cmbBldg & "'"
Me.FilterOn = True

Then you don't need the clear or search buttons or any code related to them. This will only allow you to search on one building value, but that is what you asked for. However, if you want the form to open with no records, then you need a different approach as per last paragraph in this post.

STARTUP FORM
I create a 1 pixel bmp image with the same name as the db (Test.bmp) in the db folder. This is supposed to suppress the Access splash screen, but for me it's too fast these days to be sure. Of course, you have to launch the db itself, not Access. Open Access first and of course, you will see the Access splash screen.

Set the startup form to be your splash form. This form gets a Timer property (say, 3 seconds) and a Timer event with
DoCmd.Close
DoCmd.OpenForm "frmSearchAfc"

Splash opens up (use an informative form with things like db title, version number, copyright etc.), stays visible for 3 seconds and main form opens.

If you want this main form to load in the background because it returns lots of records, then use the timer event to open the main form hidden for a period of time, then close the splash, then unhide the main form. Either way, the main form is going to open with all records showing because the combo will be empty at that point. If you want to open it blank and stay that way until a combo value is chosen, you do not set the form recordsource property in the property sheet but instead add code for that in the combo after update event.

Later....
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
Search Button...………..(can't use combo didn't work well had to change long story short need multiple search fields)
I want the search button to work for only the records in that bldg. as I have a 100+ buildings with tens of thousands of records. I want to filter out the rest of the buildings when I load up the form and keep it that way. (without having to use different queries or forms for each building)

Splash Screen or Loading Screen
Splash screen just want it to mask some forms when I maximize them. It is very quick but doesn't look like a clean load for some of my forms. So the code would look like what for this main form or form I want to go to? (on timer event - Hide main form - close splash or loading form - then unhide correct?) Tried so many combinations with all this.

Thanks for the help....
 

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
(can't use combo didn't work well had to change long story short need multiple search fields)
Sounds familiar, but perhaps is simply another example of "can't do" because you don't know how? Regardless, things seem to be getting somewhat cryptic. I mean, if you need to search on several fields but you post something that indicates there is only one field (because you only provide one control and say nothing about multiples) then I'm either wasting my time providing what isn't wanted, or I missed where you indicated that, in which case it's my fault. As for the splash screen, it seems you don't want a splash screen - you want a "wait" form - something to indicate loading but for several forms, kind of like an hourglass thing. Another misunderstanding?

I can't understand why you'd want to "mask" (hide??) a form when you maximize it. The whole point of maximizing is to make the form active and enlarge it to the max. To want to cover it up with something during that process makes no sense to me and I'm not even sure it's possible. Perhaps you should be using overlapping windows, not tabbed forms?

Maybe provide a link to whatever thread where you said you can not use combo like millions of other people so I can read up on it and maybe understand? The need for searching on multiple fields (whatever that means) implies more combos? Especially since you're filtering on existing data? To allow people to freely type search values in a textbox is not a good idea IMHO.
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
Combo Box
I don't know what to say but combo box option has already been decided not to be done. Not to say it's not a good idea. Try to explain better 100+ buildings want to search any kind of phrase for equipment. Query made up for all equip for every building. Don't want other buildings because search could bring up 100+ records for say a search of pump 1. If the form loads for one building will show only one record if search for pump 1 is done. Users should not have to search for the bldg. BBB then have to search pump 1 if they are in that section of the db.

Loading Screen
When I open a form and it looks unpleasant to the eye as some computers slower then others I need to mask the screen until it loads. Pop up, maximized form on some forms very unpleasant to the eye even for a second when it loads up.
 
Last edited:

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
want to search any kind of phrase for equipment.
OK, no combo. The quoted statement doesn't help because you search data in fields, not phrases. If you're asking to have one textbox and have Access figure out what table and/or field you want to search then good luck with that. It would explain why you need hundreds of forms though.

I'm going to drop the search and splash thing because discovering the whats (like "mask the screen") and the whys are too tortuous for me. Maybe I will figure out something regarding the images and button placements, but I'm somewhat reticent because of the objections that will likely be raised. I'm beginning to think that even if anyone can figure this out for you, there's no guarantee that you won't just keep what you already have (especially if it's working) rather than start over. I have no desire to prove anything if you're happy with what you have.
 
Local time
Today, 14:00
Joined
Dec 13, 2019
Messages
79
My terminology is not good obviously. Yes looking in fields in one query for barcodes, nameplates, amperages with the text box search(Like 10 fields). I guess I was relying on the test database too much to see what is going on with the form. I’m open to changing anything but this has been decided and there was a couple meetings on how the search would be done. I started with just 2 to 3 combo boxes and it blew up from there.
 
Last edited:

Micron

AWF VIP
Local time
Today, 16:00
Joined
Oct 20, 2018
Messages
3,478
I’m open to changing anything but this has been decided
Well, that's another example of mixed messages. I and others have posted how to reduce the number of forms but given the way this has gone, I'm going to leave you to either design accordingly and implement those suggestions or not. I cannot help but think that I'd do all that work only to find that you or your boss decided to stick with the status quo rather than dump all that work. I wish you good luck with your database.
 

Users who are viewing this thread

Top Bottom