conditional formatting, mouse tooltip, and time compairison (1 Viewer)

benh76135

Registered User.
Local time
Today, 08:49
Joined
Jul 1, 2015
Messages
21
what i have: a form with a sub form with a text box that says 10/13/2016 05:00:00 am

the record source for this form is a query with po number, part name, start day, end day, batch, week, yr

a sample record is p8888, type 218, 10/11/2016 08:00:00 am, 10/13/2016 02:00:00 pm, 2, 42, 2016

what i am trying to do is highlight said text box a specific color and create a tool tip showing entire record because its time and date falls between the start and end times and because the batch number equals 2

the query should have between 0 and 25 records, and none should overlap the time period but if they do I am not sure how that should be handled

i want to run it in the main forms on load event

I have no idea where to start attempting to program this and I realize it is a bit of an odd idea to do, but it is a starting point for a project i am working on. Any help is very much appreciated.
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:49
Joined
Jul 9, 2003
Messages
16,429
I gather from what you've described that you're not following the normal database design.

I think you would be better off explaining what you are trying to do from the business requirements point of view, not what you want to appear on the screen, then you can get some advice on the best way to go about it.

Sent from my SM-G925F using Tapatalk
 

benh76135

Registered User.
Local time
Today, 08:49
Joined
Jul 1, 2015
Messages
21
in this instance I'm probably not following normal structure, but it is the only way i can think of to get the idea started before adjusting it to be more efficient... I have such a large program at the moment it confines me on how i can program this feature.


i did adjust my starting query to add another field labeled tooltip

i guess a simple question would be how do i get a text box to change background color if its date is between the two dates of a record in my query then also change the mouse tooltip to the tooltip in the same record of that query

if ([query].[batch]=1 And ([main form]![sub form]![textbox] between [query].[start day] and [query].[end day]) then [main form]![sub form]!txtbox.BackColor = rgb 100,100,100 and [main form]![sub form]!txtbox.tooltip =[query].[tooltip]

what is wrong with that ?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:49
Joined
Jul 9, 2003
Messages
16,429
I don't know, probably nothing.

The issue is you are asking for help and advice and from what you've written already I'm suggesting you recap and take some advice before you get going as it were.

Now maybe you've gone a good way already sort of in the wrong direction and you are in difficulties.

You have a choice, you can carry on and I'm sure you will eventually get things working to your satisfaction especially if you happened upon some code or find someone who has gone in the same direction before.

However a better choice would be to have a rethink, get your access database more in line with the generally accepted way of doing things and then a world of help opens up to you, because everything you plan and want to do is known and has known and recognised ways of doing it.

I'm not saying don't do it the way you're doing it, that's your choice. No doubt you will be able to come up with your own unique methods. However you will find there is little help available, not because no one wants to help you, but because you are embarking into uncharted territory, "where no one has gone before.

How do I know this? I'm inclined to follow my own methods, I find it very useful and educational. It's like a hobby. I learn lots of new things accidentally, but it takes loads of time, patience and is sometimes frustrating! I'm just showing you what's ahead of you if you go that way, it's not a bad way it's just not the best way.

Sent from my SM-G925F using Tapatalk
 

sneuberg

AWF VIP
Local time
Today, 06:49
Joined
Oct 17, 2014
Messages
3,506
Do you have Access 2010 or later. If so conditional formatting is relatively easy and is described here. If you have some version prior to 2010 this is difficult. Let me know and I'll see if I can find the procedure for doing it.

Tool tips are per control so you can't get one per record in a continuous form if that's what you want to do. You might be able to create you own system using the mouse move event. I believe I've seen someway to make it act like a mouse over event.
 

benh76135

Registered User.
Local time
Today, 08:49
Joined
Jul 1, 2015
Messages
21
i use office 365, so yes newest version of access.

I've messed with the mouse move and other mouse events. caused me problems.
 

Users who are viewing this thread

Top Bottom