>Hi,
>
[quoted text clipped - 12 lines]
>strDocName = " go to form "
>strDocName2 = " Report Ment
If the above is your actual code it's not making sense. There's no close quote
on the second line; the leading and trailing blanks won't work with form or
report names.
>If ([Notification] = "NO") Then
What is the datatype of [Notification]? If it's a yes/no field then it is NOT
a text string and it will never be set to the text string "NO". And how does
answering the questions affect the value of [Notification]?
>MsgBox " You did not complete the questions "
>
>strLastname ="= ' " & Me.LastName & " ' "
>
>strCriteria =" [tbl_Players] " & strLastname
Why the extra variable and extra step?
strCriteria = "[LastName] = """ & Me!LastName & """"
using the fieldname (which you can search) rather than the tablename (which
you can't), and doublequote delimiters rather than singlequote delimiters
which will fail with a LastName such as O'Brien.
>DoCmd.OpenForm stDocName, , , strCriteria
>
>Exit Sub
>End if
>
>If ([Notification] = "YES") Then
An Else statement rather than an End If and another If will work here, and be
simpler.
>MsgBox " Thank you for completing the questions"
>
>strLastname ="= ' " & Me.LastName & " ' "
>
>strCriteria =" [tbl_Players] " & strLastname
>DoCmd.Openform stDocName2, , , strCriteria
If you're trying to open a Report, use OpenReport rather than OpenForm.
>Exit Sub
>End if
>
>*************************************************
John W. Vinson [MVP]
learning_codes@hotmail.com - 18 Dec 2007 10:46 GMT
On Dec 18, 1:03 am, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:
> On Mon, 17 Dec 2007 20:13:28 -0800 (PST), "learning_co...@hotmail.com"
>
[quoted text clipped - 67 lines]
>
> - Show quoted text -
Thanks,
I did not use yes/no. I use the text field if Yes or No to help me
which one
to go the form (2 forms).
I guess it will not work on from. Is that correct ?
Thanks
John W. Vinson - 18 Dec 2007 17:28 GMT
>I did not use yes/no. I use the text field if Yes or No to help me
>which one
>to go the form (2 forms).
>
>I guess it will not work on from. Is that correct ?
Well, your code as written evidently will not work because it doesn't work.
But since I do not know anything about your form names, how the form is
structured, your fieldnames, etc. I cannot immediately help you get it to
work.
But yes - with correctly written code, you CAN use a text value in a textbox
to decide which form to open.
Please post some more details (the actual names of the forms for example) and
I'll try to help.
John W. Vinson [MVP]