Visualising of machine status/log (1 Viewer)

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:59
Joined
May 7, 2009
Messages
19,232
if you can give a mock-up sample of the graph.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
Sorry, it's not possible. It's only possible with cycletimes of the machines. Forget it.
Thanks for the reply.
Bieke
arnelgp, can you tell me how you do the painting of the bar? You use "PaintWithblack", is this an instruction? I neither can't find a function with that name?

Bieke
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:59
Joined
May 21, 2018
Messages
8,527
Here is my approach which is really just a different implementation of what @CJ_London proposed. It is set up to handle an unlimited amount of machines, but you will have to copy and paste a subform for each machine, and give it the proper name which should be the same for @cj_lodon. I set it up to handle no more than 200 events per machine. I also added the double click on a failure to see its details.
status2.jpg
 

Attachments

  • Alarms.accdb
    620 KB · Views: 93
Last edited:

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
Here is my approach which is really just a different implementation of what @CJ_London proposed. It is set up to handle an unlimited amount of machines, but you will have to copy and paste a subform for each machine, and give it the proper name which should be the same for @cj_lodon. I set it up to handle no more than 200 events per machine. I also added the double click on a failure to see its details.
View attachment 96944
Looks nice but i can't see the timelines?
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:59
Joined
May 21, 2018
Messages
8,527
Did you select a date from the pulldown?
In theory you could have a timeline for each machine. You would only want to show timelines for a form on that date.
Any chance you could post a table with all the data? That way can demonstrate picking different dates and how to handle showing different time lines based on data for that date.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
Did you select a date from the pulldown?
In theory you could have a timeline for each machine. You would only want to show timelines for a form on that date.
Any chance you could post a table with all the data? That way can demonstrate picking different dates and how to handle showing different time lines based on data for that date.
Hello MajP, The problem was that the date format was MMDDYYY and in belgium it is MMDDYYY.
I'm now expand the form for 40 machines. I will post a real screenshot from live data.
Thank u very much for this, also for everyone who helped with this topic. (sorry for my englisch)

Kind regards,
Bieke
 

isladogs

MVP / VIP
Local time
Today, 02:59
Joined
Jan 14, 2017
Messages
18,216
Hello MajP, The problem was that the date format was MMDDYYY and in belgium it is MMDDYYY.
I'm now expand the form for 40 machines. I will post a real screenshot from live data.
Thank u very much for this, also for everyone who helped with this topic. (sorry for my englisch)

Kind regards,
Bieke
Umm...did you really mean YYY x3 as that will give nonsense results.

Anyway, that's exactly the same format in each case which for today would give
?Format(Date,"mmddyyy")
121821352
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:59
Joined
May 21, 2018
Messages
8,527
I think if you change the rowsource on my combobox to
Code:
SELECT DISTINCT Int([dtsStart]) AS DateStart FROM Alarms;
the rest of the demo should work.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
Umm...did you really mean YYY x3 as that will give nonsense results.

Anyway, that's exactly the same format in each case which for today would give
?Format(Date,"mmddyyy")
121821352
sorry i mean your format was MMDDYYYY and ours is DDMMYYYY.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
arnelgp, can you tell me how you do the painting of the bar? You use "PaintWithblack", is this an instruction? I neither can't find a function with that name?

Bieke
arnelgp, can you explaine this for me? You use "PaintWithblack", is this an instruction? I neither can't find a function with that name? I find your solution with excel very nice, also for other applications. I tried to understand your code but i'm stuck with this question.

Thanks in advance.
Bieke
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:59
Joined
May 7, 2009
Messages
19,232
see the mach_viz.xlsm.
on Sheet1 (VBA), it has all the public function.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
Here is my approach which is really just a different implementation of what @CJ_London proposed. It is set up to handle an unlimited amount of machines, but you will have to copy and paste a subform for each machine, and give it the proper name which should be the same for @cj_lodon. I set it up to handle no more than 200 events per machine. I also added the double click on a failure to see its details.
View attachment 96944
Goodmorning MajP,

I'am added some data, i copied a part of the data from 700A en make new records under 700B. When i run the form there is a part of the data from 660F that is added in the timeline of 700B. For you probably easy to explane :)
Find attached my version.

1639906880581.png
 

Attachments

  • Alarms.accdb
    752 KB · Views: 98

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:59
Joined
May 21, 2018
Messages
8,527
When I built the timeline I needed 200 labels stacked in the corner and invisible. I gave them width and height of 100 pixels so I could see that it was working. I was not going to do that by hand. Here is the code, it is in the module
Code:
Public Sub Build()
  Dim frm As Access.Form
  Dim ctrl As Access.Label
  Dim i As Integer
  DoCmd.OpenForm "frmTimeline", acDesign, , , , acHidden
  Set frm = Forms("frmTimeLine")
  For i = 1 To 200
    Set ctrl = Application.CreateControl("frmTimeLine", acLabel, acDetail, , , 0, 0, 100, 100)
    With ctrl
      .Name = "lbl" & i
      .BackStyle = 1
      .BackColor = vbRed
      .Visible = False
    End With
  Next i
End Sub

Likely when you were testing something happened that put the form into design view and you saved it as so.
redesign.jpg


So you now saved the default with some visible controls and tag properties. I think the far one is lbl10.
When the code runs it unhides the controls it needs, moved to correct location, and resizes it. If you use >10 labels on a given timeline then no problem. But if you use less then it will not move or retag the controls so it appears left over.

You could just fix this, but in case it happens again I added code so the first thing it does is restack and hide all labels before moving and resizing.
Code:
Public Sub ResetLabels()
  Dim ctrl As Access.Label
  Dim i As Integer
  For i = 1 To 200
    Set ctrl = Me.Controls("lbl" & i)
    With ctrl
      ctrl.Tag = ""
      ctrl.Left = 10
      ctrl.Width = 10
      ctrl.Visible = False
    End With
  Next i
End Sub
 

Attachments

  • MajP_Alarms2.accdb
    628 KB · Views: 97

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
When I built the timeline I needed 200 labels stacked in the corner and invisible. I gave them width and height of 100 pixels so I could see that it was working. I was not going to do that by hand. Here is the code, it is in the module
Code:
Public Sub Build()
  Dim frm As Access.Form
  Dim ctrl As Access.Label
  Dim i As Integer
  DoCmd.OpenForm "frmTimeline", acDesign, , , , acHidden
  Set frm = Forms("frmTimeLine")
  For i = 1 To 200
    Set ctrl = Application.CreateControl("frmTimeLine", acLabel, acDetail, , , 0, 0, 100, 100)
    With ctrl
      .Name = "lbl" & i
      .BackStyle = 1
      .BackColor = vbRed
      .Visible = False
    End With
  Next i
End Sub

Likely when you were testing something happened that put the form into design view and you saved it as so.
View attachment 96969

So you now saved the default with some visible controls and tag properties. I think the far one is lbl10.
When the code runs it unhides the controls it needs, moved to correct location, and resizes it. If you use >10 labels on a given timeline then no problem. But if you use less then it will not move or retag the controls so it appears left over.

You could just fix this, but in case it happens again I added code so the first thing it does is restack and hide all labels before moving and resizing.
Code:
Public Sub ResetLabels()
  Dim ctrl As Access.Label
  Dim i As Integer
  For i = 1 To 200
    Set ctrl = Me.Controls("lbl" & i)
    With ctrl
      ctrl.Tag = ""
      ctrl.Left = 10
      ctrl.Width = 10
      ctrl.Visible = False
    End With
  Next i
End Sub
Thanks for helping me out, i ren to your code and i understand it now. Have a nice day. Regards Bieke.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
Thanks for helping me out, i ren to your code and i understand it now. Have a nice day. Regards Bieke.
When I built the timeline I needed 200 labels stacked in the corner and invisible. I gave them width and height of 100 pixels so I could see that it was working. I was not going to do that by hand. Here is the code, it is in the module
Code:
Public Sub Build()
  Dim frm As Access.Form
  Dim ctrl As Access.Label
  Dim i As Integer
  DoCmd.OpenForm "frmTimeline", acDesign, , , , acHidden
  Set frm = Forms("frmTimeLine")
  For i = 1 To 200
    Set ctrl = Application.CreateControl("frmTimeLine", acLabel, acDetail, , , 0, 0, 100, 100)
    With ctrl
      .Name = "lbl" & i
      .BackStyle = 1
      .BackColor = vbRed
      .Visible = False
    End With
  Next i
End Sub

Likely when you were testing something happened that put the form into design view and you saved it as so.
View attachment 96969

So you now saved the default with some visible controls and tag properties. I think the far one is lbl10.
When the code runs it unhides the controls it needs, moved to correct location, and resizes it. If you use >10 labels on a given timeline then no problem. But if you use less then it will not move or retag the controls so it appears left over.

You could just fix this, but in case it happens again I added code so the first thing it does is restack and hide all labels before moving and resizing.
Code:
Public Sub ResetLabels()
  Dim ctrl As Access.Label
  Dim i As Integer
  For i = 1 To 200
    Set ctrl = Me.Controls("lbl" & i)
    With ctrl
      ctrl.Tag = ""
      ctrl.Left = 10
      ctrl.Width = 10
      ctrl.Visible = False
    End With
  Next i
End Sub
Hello majP,

The format from the dtsstart and dtsstop are changed in the alarm table, they have now this format :
7/01/2021 20:45:57.0000000 can you change for me your sql code so it works again :
strSql = "Select distinct Name from alarms where int(dtsStart) = #" & Format(Me.cmboDate, "mm/dd/yyyy") & "#"

Thanks in advance
Bieke
 

Attachments

  • Shopfloor.accdb
    4.6 MB · Views: 88

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:59
Joined
May 21, 2018
Messages
8,527
I have never worked with the "date time extended" data type. If you do not absolutely need it then get rid of it and make it a Date field. It is impossible to work with. I cannot not figure out how to use it. You cannot do any date time functions on it without a datatype mismatch. I would have to ask around. I have tried about 10 ways to get it into a date data type and everything fails.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:59
Joined
May 21, 2018
Messages
8,527
See discussion
This is not a formatting issue. This data type is not compatible with VBA. It will take a workaround if needed.
 

Bieke

Member
Local time
Today, 03:59
Joined
Nov 24, 2017
Messages
57
I have never worked with the "date time extended" data type. If you do not absolutely need it then get rid of it and make it a Date field. It is impossible to work with. I cannot not figure out how to use it. You cannot do any date time functions on it without a datatype mismatch. I would have to ask around. I have tried about 10 ways to get it into a date data type and everything fails.
It is not possible to change this field because it is a table of a general data management package.
This is the first time that i see such a dataformat. You even can’t find anything on the net.

Thanks
Bieke
 

Users who are viewing this thread

Top Bottom