# \[Solved\] OPEN SCREEN only works after leave the screen and back again

**URL:** <https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [September 16, 2019, 3:52pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366 "2019-09-16T15:52:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![romerofreire7z3](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/romerofreire7z3/32/37210_2.png) [@romerofreire7z3](https://community.thunkable.com/u/romerofreire7z3)\
**Post date:** [September 16, 2019, 3:52pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/1 "2019-09-16T15:52:56Z")

</div>

Hello

I have a problem: the event OPEN SCREEN just works only leave the screen and back again.

[Animated GIF with the problem](https://drive.google.com/open?id=1gXvZG2F0DkMElsP5kgO-fQnFi7xypsoC)

 ![01_Problema_01](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/1690c699b31fbb03a5889c1377805e605a6d49b9.png) ![01_Problema_02](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/4/a42c1427029dbda4930d72559483961ca2d0878b.png)

I will be glad for help.

Thanks

Romero.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [September 16, 2019, 4:41pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/2 "2019-09-16T16:41:16Z")

</div>

hi @romerofreire7z3 👋

Did you try using the `Painel.Starts` event instead of `Painel.Opens`? This should run each time this screen is displayed.

Thanks.

---

<div class="post-metadata">

**Author:** ![romerofreire7z3](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/romerofreire7z3/32/37210_2.png) [@romerofreire7z3](https://community.thunkable.com/u/romerofreire7z3)\
**Post date:** [September 16, 2019, 4:52pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/3 "2019-09-16T16:52:05Z")

</div>

Hi @domhnallohanlon!

Yes I’d try OPEN, START and both and nothing works.

Thanks.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [September 16, 2019, 5:01pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/4 "2019-09-16T17:01:14Z")

</div>

Now that I look a little closer, I think this might have more to do with the time taken to complete the 3 function you call on startup.

Is there a particular reason for running the `ProcLeMensagem` function twice?

Also, can you share a screenshot of the `FuncDataCorrenteInvertidaYYYYMMDD` function too?  
Is this function declared on the `Painel` screen?

---

<div class="post-metadata">

**Author:** ![romerofreire7z3](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/romerofreire7z3/32/37210_2.png) [@romerofreire7z3](https://community.thunkable.com/u/romerofreire7z3)\
**Post date:** [September 16, 2019, 5:16pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/5 "2019-09-16T17:16:06Z")

</div>

Well

I call ProcLeMensagem twice in a desperated shoot.

The function FuncDataCorrenteInvertidaYYYYMMDD is declared and follows the code:

![01_Problema_03](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e1c53fcf9933cbf76863ebdf24ea99eda7379cbf.png)

Thanks

Thanks.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [September 16, 2019, 5:37pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/6 "2019-09-16T17:37:36Z")

</div>

Thanks!

> [@romerofreire7z3](#):
>
> function FuncDataCorrenteInvertidaYYYYMMDD is declared and follows

Is it declared on the same screen that calls it?

---

<div class="post-metadata">

**Author:** ![romerofreire7z3](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/romerofreire7z3/32/37210_2.png) [@romerofreire7z3](https://community.thunkable.com/u/romerofreire7z3)\
**Post date:** [September 16, 2019, 5:39pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/7 "2019-09-16T17:39:16Z")

</div>

Yes. it is declared on the same screen that calls it.

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [September 16, 2019, 8:45pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/8 "2019-09-16T20:45:28Z")

</div>

What sets the initial value of “contmensagem”?

I see you have logic to increment it, but nothing showing what value it starts with.

---

<div class="post-metadata">

**Author:** ![romerofreire7z3](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/romerofreire7z3/32/37210_2.png) [@romerofreire7z3](https://community.thunkable.com/u/romerofreire7z3)\
**Post date:** [September 17, 2019, 12:52pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/9 "2019-09-17T12:52:26Z")

</div>

Hi my friends!

I got the solution. I rewrote the code, tooking off the function and did some changes. And I works.

Thanks @domhnallohanlon and @CBVG for the help.

 ![01_Problema_04_Solu%C3%A7%C3%A3o](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/f/2fc9510c70717c4bc7c8fa17ab1ff2f3da9e2a48.png)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:09pm UTC](https://community.thunkable.com/t/solved-open-screen-only-works-after-leave-the-screen-and-back-again/229366/10 "2024-11-08T12:09:00Z")

</div>


