YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

on click button or rectangle color change ??? Options · View
Joep
#1 Posted : Sunday, February 27, 2011 3:29:13 PM
Rank: Newbie
Groups: Member

Joined: 2/27/2011
Posts: 4
Hi all,

new to this forum so i'll introduce myself a little bit: My name is Joep and i'm from the Netherlands. At my work i'm using Processbook a lot but till now with only the build in features. Meaning i'm a noob to VB scripting.

At this moment i'd like to make a screen for a touch screen at our reception area. It should be very simple and i think the answer will be but then again n00b Smile

What i want:

A screen with all employee names and beside that one or two buttons or rectangles saying: PRESENT or ABSENT.
So, when an employee steps into the building he or she just have to push the button to show he or she is PRESENT. When leaving pushing it again so he or she is ABSENT.

Any one has an idea?

Thanks,
Joep
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
Joep
#2 Posted : Wednesday, March 02, 2011 12:24:48 AM
Rank: Newbie
Groups: Member

Joined: 2/27/2011
Posts: 4
Found something and works fine! No color change, but just the button text changes when clicked (to 'no text' and PRESENT

code:


Private Sub UserForm_Initialize()
CommandButton1.Accelerator = "C" 'Set Accelerator key to ALT + C Button 1 is NAME EMPLOYEE
End Sub


Private Sub CommandButton1_Click()
If CommandButton1.Caption = "" Then 'Check caption, then change it.
CommandButton1.Caption = "PRESENT"
CommandButton1.Accelerator = "C" 'Set Accelerator key to ALT + C
Else
CommandButton1.Caption = ""
CommandButton1.Accelerator = "O" 'Set Accelerator key to ALT + O

End If
End Sub
RJK Solutions
#3 Posted : Monday, March 14, 2011 9:42:49 AM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
Hi Joep,

Welcome to the forum.

Are you also looking to store the date time that an employee clicks the Present/Absent option? If you have a PI tag for each employee then you can just use the Rectangle symbol with a multistate and little bit of VBA (for updating the PI tags). Using Multistate you can change the colour of the Rectangle.

Do you currently have a button for each employee?
Principal Consultant
Real-Time Data Management @ Wipro Technologies
Joep
#4 Posted : Sunday, March 20, 2011 6:36:23 AM
Rank: Newbie
Groups: Member

Joined: 2/27/2011
Posts: 4
Hi,

it's working fine at the moment. Yes i made a button for each employee. We don't need the time administration option because we got a relaxed boss Smile

What i will have to find out now is how to make a PRINT button in vba. When there's an alarm and all employees need to gather in a certain place it would be easy to just click the button and the a print out of the current on site employees.

Regards,

Joep
OlJo69
#5 Posted : Thursday, June 16, 2011 10:45:51 AM
Rank: Newbie
Groups: Member

Joined: 3/4/2011
Posts: 6
Location: France
Hi Joep,

To print the current view you can you use the following method:
Code:
Private Sub CommandButton1_Click()
Application.ActiveDisplay.PrintOut
End Sub

This will open the default Windows Printer interface.

Hope this helps Smile
O.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.