Input Box issues, cancel button does not work

B

buscher75

If anyone can help, I would really appreciate it.

There is what I want to happen:
The employee clicks the incomplete checkbox and the Comment input box opens
up. This happens. As long as I enter a value this process works and the
cursor moves on to the Audit checkbox.

If the employee hits the cancel button, I would like the input box to
disappear, keep the Comments field null and deselect the Incomplete checkbox.
Then move to the Audit checkbox. This does not happen.

Currently, if I do not enter a value and hit enter or cancel, the loop in
the code prompts the box to open again. I cannot close the input box.

I tried to delete the loop, but it will not function without it. I have
tried numerous things but have had no luck. I set the “allow zero length†in
the table to “yes†for the comments field, also.

Can anyone help? Thank You!



Private Sub Incomplete_Click()
If Incomplete Then
Comments.Visible = True
Me.Comments.SetFocus
Do While Nz(Comments.Text, "") = ""
Comments = InputBox("Reason why unit can not be GT")
Loop

Else
Comments = Null

End If
Me.Audit.SetFocus

End Sub
 
D

Dale_Fye via AccessMonster.com

Try this:

Private Sub Incomplete_Click()
If Incomplete Then
Comments.Visible = True
Me.Comments.SetFocus
me.Comments = InputBox("Reason why unit can not be GT")
if LEN(me.comments & "") > 0 then
me.Audit.SetFocus
else
me.Incomplete = false
Call Incomplete_Click
endif
Else
me.Audit.setfocus
me.Comments = Null
me.Comments.Visible = false
End If

End Sub

HTH
Dale
 
B

buscher75

It works great, your the best!

Thanks!



Dale_Fye via AccessMonster.com said:
Try this:

Private Sub Incomplete_Click()
If Incomplete Then
Comments.Visible = True
Me.Comments.SetFocus
me.Comments = InputBox("Reason why unit can not be GT")
if LEN(me.comments & "") > 0 then
me.Audit.SetFocus
else
me.Incomplete = false
Call Incomplete_Click
endif
Else
me.Audit.setfocus
me.Comments = Null
me.Comments.Visible = false
End If

End Sub

HTH
Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top