Full Version: Site Map Form
UtterAccess Forums > Microsoft® Access > Access Forms
mhearnsww
My boss wants to have a site map in the database, so he knows how to get to every single form.
That i have is a button on every form that links to the site map form. On the site map form, i have a command button for every form in the database. I have listed it as a hierarchy.
What i want to do and seem to have some trouble doing is, when you are on the main menu form and click onto the site map, i want the site map to display and next to the command button on the site map for Main Menu, i want a little message to display and say 'You are here' and also make the text on the command button for the main menu bold.
Obviously i want this to happen for every button when you come from those forms to the site map.
The bit i dont know in VBA is the coding to say.......
IF main menu form is open then
make label 'visible'
make label caption 'you are here'
make text on command button 'bold'
end if
Is there anyway that i can implement this?
freakazeud
Hi,
you could use the openargs argument if you close the forms, but since you are leaving them open you can try:


If CurrentProject.AllForms("YourForm").IsLoaded Then
Me.YourLabel.Visible = True
Me.YourLabel.Caption = "whatever"
Me.YourLabel.FontWeight = 700
End If

Untested!
HTH
Good luck
mhearnsww
Thank you for that, it worked perfectly.
On this same site map form, i have used two labels to see that it is working. Instead of having about 30 different labels on the site map form to display 'you are here', i want to have one label and list the co-ordinates for it, so that same label will move around the form.
I've added it into vba with left, top, width, and height but it doesnt display on the form. I've made sure it is not under a button because i've put the same co-ordinates to where the 2nd label was.
Do you have any ideas?
freakazeud
Hi,
just use the top and left property of the control:
e.Label5.Left = 500
Me.Label5.Top = 500
HTH
Good luck
mhearnsww
Thank you, it works fine now.
freakazeud
You're welcome.
Glad I could assist.
Good luck on future projects!
mhearnsww
When i have clicked on a button on the site map form and go to the form that i've selected, the previous form is still left open. If i want to click a button for a form on the site map it then takes me to that form. The problem is that it leaves the form previous to when i opened up the site map form open. Instead of listing about 20-30 docmd.close for all the forms, is there a bit of code that says, 'all forms that are open before you went onto the site map form will be closed' when you click on any of the buttons on the site map form.
freakazeud
Hi,
have a look at this earlier discussion!
Oinclude code which closes ALL forms, but the one specified.
So this would be your sitmap form.
HTH
Good luck
mhearnsww
Thanx for that, i've got it working now.
One other thing, when you move the mouse cursor over a button, i've got it to make the text bold on that button but when you move off the button, it still stays bold. Is there a way to make the text change back to normal when you move the cursor off the button?
freakazeud
Check the forms mousemove event to change it back.
HTH
Good luck
mhearnsww
yeah, i've put the code into the mousemove event.
If Me!Cmd1.FontBold = False Then
Me!Cmd1.FontBold = True
Else
Me!Cmd1.FontBold = False
End If
I've got that to work now and it does change back and forth from bold to normal text. The problem is that it changes too quickly and if i slowly drag the mouse cursor over the button, it flickers between the two. It doesnt just stay on bold while u have the mouse cursor over the button.
freakazeud
That's probably because the label is too small. Try to make it a little bigger.
HTH
Good luck
mhearnsww
no i tried that. It just seems to flicker between the two. The text somtimes gets stuck as well. When it flickers and i come off the button it sometimes stays bold.
freakazeud
Mhhh...try to convert the labels to textboxes to see if that will do anything!
HTH
Good luck
mhearnsww
Its doing exactly the same thing.
freakazeud
Mhhh I don't know...it must have to do with the labels being unattached.
I'm not sure what else we can try.
HTH
Good luck
mhearnsww
Its ok, i'm off home now from work. Thanx for all your help today.
mhearnsww
You keep mentioning labels. I'm using command buttons if that makes any difference.
freakazeud
well that might be our issue then frown.gif! Try to use labels instead. You can make them look like a command button and format them the way you need to. Use their mouse move event and see if that changes anything.
Try it with one and if it works then change all.
HTH
Good luck
mhearnsww
I've just put a label on the form and it is doing the same thing. It keeps flickering when u move the mouse over it. I think the reason why it flickers is because when the mouse goes over the first letter, it makes it bold, but as soon as it comes off that first letter and goes to the second letter, it then changes the text to normal and once again when it goes over the second letter it changes it back to bold. I think this is why it is flickering.
freakazeud
It shouldn't! The label is an area (the rectangle) and if you move the mouse onto that rectangle then the action should happen in the mouse move event, if you move it off, then the action behind the mouse move event of the form should take place, if you don't move it off and just move around on the label nothing should happen! Can you post your code behind the mouse move event of the label?
HTH
Good luck
mhearnsww
No matter how big the size of the label, when i move the mouse around it, it just flickers.
Private Sub Label39_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me!Label39.FontBold = False Then
Me!Label39.FontBold = True
Else
Me!Label39.FontBold = False
End If
End Sub
freakazeud
Hi,
try to NOT do the evaluation. Maybe it hangs with that. There is no real need for it:
Private Sub Label39_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!Label39.FontBold = True
End Sub
Than change it back with only that one line (False) in the mousemove event of the form.
HTH
Good luck
mhearnsww
I just tried it and it turns bold when you move over the label, but it doesnt make the text go back to normal when you move off the label.
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Me!Label39.FontBold = False

End Sub
Private Sub Label39_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!Label39.FontBold = True

End Sub
freakazeud
Make sure the mousemove event of the form actually fires. Put a msgbox in it as well.
If it doesn't fire then you are not executing the mousemove event!
HTH
Good luck
mhearnsww
ok i've put the following code into the form mouse move event
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me!Label16.FontBold = True Then
MsgBox "It Didnt Work!", vbInformation
End If
End Sub
and nothing happened.
Why is it not executing the mousemove event?
freakazeud
Try to move off the detail section of the form and see if it executes.
Also take out the if then else statement, the validation won't help. Just try to execute the msgbox.
HTH
Good luck
mhearnsww
i took the if out and moved the mouse off the form, but it still didnt execute the msgbox.
freakazeud
Mhhh...can you attach the db so I can take a look at it?
Zip it and keep it under 500kb. Keep all confidential info out.
HTH
Good luck
mhearnsww
The zip file is only 442kb but when i try to attach it, it comes back with unable to proceed.
freakazeud
Mhhh that is wierd.
Try to compact the db before you zip (tools--database utilities--compact and repair). Then create a new zip file. This should be smaller now. Not that it should matter, but you never know!
HTH
Good luck
mhearnsww
The database is set up to compact on close.
freakazeud
mhh I don't know why attaching the file doesn't work.
mhearnsww
Sorry about that, i attached the wrong one. The other one was over 500kb.
mhearnsww
I meant to say, the one i was trying to attach before was the wrong one. The one i've actually attached is the right one.
mhearnsww
Hi, did you manage to have a look at the database?
freakazeud
Hi,
Odon't get a notification that you replied when you reply to yourself. Try to not use the quick reply on the bottom rather then the reply button at the person you are trying to reply to.
I took a look at your db and I don't see why you didn't get it to work. I changed what you wanted with the first 4 buttons (see attachment):
Job Overdue pop up
- repairs
- search site for leak
- add or update leak
Go over them with your mouse and see if they turn bold and go back to normal when you move of the bottom.
If yes then pay attention to the button's mouse move event and to the details section mouse move event.
HTH
Good luck
mhearnsww
Sorry about that, before you said to put it on the form mousemove event, now i've moved it to the details mousemove event and its working perfectly now.
That do you think the problem was before when it kept flickering while moving around on the button?
Thanx for your paitence and help.
freakazeud
Maybe because the code wasn't in the form's detail section frown.gif
Glad I could assist.
Good luck on future projects!
ace
Take a look at the attached file for another way to setup rollovers for
multiple controls of the same type.
mhearnsww
Ace, thanx for that.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.