|
|
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  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
|
|
|
|
|
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.
|
|
|
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
|
|
|
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
|
|
|
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  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
|
|
|
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 O.
|
|
|
|
Guest
|