From: Bateman28 on
Hi

I have a form that has VB for different fields within the main form. One of
my options is when a specific field is ticked the corresponding fields that
need to be completed have there backcolour change so the agent becomes aware
of the fields. I also have VB code set so that when specific fields are
completed the "Finish" button becomes visable to ensure all the needed data
is captured. The issue is that once the agents have completed all the
relevent information needed they are clicking the finish button and the data
is being sent to the backend of the database but the fields where the
colours changed to identify the needed criteria stay the same colour. The
second problem is the "Finish" button stays visible instead of returning to
its original state of being hiden. As you can imagine this is very annoying,
any help would be greatly appreciated

Code Example:

Private Sub chkCheckedBUG_BeforeUpdate(Cancel As Integer)

If Me!chkCheckedBUG >= 0 Then
If (IsNull(Me.chkCheckedBUG.Value) Or (Me.chkCheckedWIP.Value = "")) Then
Me.cmdFinish.Visible = False
Else
Me.cmdFinish.Visible = True
End If

Me.Refresh!

End Sub

From: Daryl S on
Bateman28 -

In the code for your Finish button, add code to clear any color formatting
on the fields. Then before you can make the Finish button invisible again,
you need to move the focus away from the Finish button. So set the focus to
another control, then set the cmdFinish.visible = False.

--
Daryl S


"Bateman28" wrote:

> Hi
>
> I have a form that has VB for different fields within the main form. One of
> my options is when a specific field is ticked the corresponding fields that
> need to be completed have there backcolour change so the agent becomes aware
> of the fields. I also have VB code set so that when specific fields are
> completed the "Finish" button becomes visable to ensure all the needed data
> is captured. The issue is that once the agents have completed all the
> relevent information needed they are clicking the finish button and the data
> is being sent to the backend of the database but the fields where the
> colours changed to identify the needed criteria stay the same colour. The
> second problem is the "Finish" button stays visible instead of returning to
> its original state of being hiden. As you can imagine this is very annoying,
> any help would be greatly appreciated
>
> Code Example:
>
> Private Sub chkCheckedBUG_BeforeUpdate(Cancel As Integer)
>
> If Me!chkCheckedBUG >= 0 Then
> If (IsNull(Me.chkCheckedBUG.Value) Or (Me.chkCheckedWIP.Value = "")) Then
> Me.cmdFinish.Visible = False
> Else
> Me.cmdFinish.Visible = True
> End If
>
> Me.Refresh!
>
> End Sub
>
From: Bateman28 on
Thats all i was missing. I changed the focus as advised and it worked a treat

Thanks for your quick response

"Daryl S" wrote:

> Bateman28 -
>
> In the code for your Finish button, add code to clear any color formatting
> on the fields. Then before you can make the Finish button invisible again,
> you need to move the focus away from the Finish button. So set the focus to
> another control, then set the cmdFinish.visible = False.
>
> --
> Daryl S
>
>
> "Bateman28" wrote:
>
> > Hi
> >
> > I have a form that has VB for different fields within the main form. One of
> > my options is when a specific field is ticked the corresponding fields that
> > need to be completed have there backcolour change so the agent becomes aware
> > of the fields. I also have VB code set so that when specific fields are
> > completed the "Finish" button becomes visable to ensure all the needed data
> > is captured. The issue is that once the agents have completed all the
> > relevent information needed they are clicking the finish button and the data
> > is being sent to the backend of the database but the fields where the
> > colours changed to identify the needed criteria stay the same colour. The
> > second problem is the "Finish" button stays visible instead of returning to
> > its original state of being hiden. As you can imagine this is very annoying,
> > any help would be greatly appreciated
> >
> > Code Example:
> >
> > Private Sub chkCheckedBUG_BeforeUpdate(Cancel As Integer)
> >
> > If Me!chkCheckedBUG >= 0 Then
> > If (IsNull(Me.chkCheckedBUG.Value) Or (Me.chkCheckedWIP.Value = "")) Then
> > Me.cmdFinish.Visible = False
> > Else
> > Me.cmdFinish.Visible = True
> > End If
> >
> > Me.Refresh!
> >
> > End Sub
> >
 | 
Pages: 1
Prev: Setting Size of Switchboard
Next: Version Updates