Need help with String

G

Guest

I can't figure out what is wrong with this. Any ideas would be appreciated.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDataReview"

stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


The Epistry Number is 123456-1 format. I know an entry exists for the one I
am testing, but the form comes up blank.


Cheers
 
W

Wayne Morgan

stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
'add the following line here
Debug.Print stLinkCriteria
DoCmd.OpenForm stDocName, , , stLinkCriteria

This will put the value of stLinkCriteria into the debug window. It should
look like

[EpistryNumber]='123456-1'

Verify that is what you get.

--
Wayne Morgan
MS Access MVP


Paul B. said:
I can't figure out what is wrong with this. Any ideas would be appreciated.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDataReview"

stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


The Epistry Number is 123456-1 format. I know an entry exists for the one
I
am testing, but the form comes up blank.


Cheers
 
G

Guest

Wayne,

I get the following

stLinkCriteria = "[EpistryNumber]='999999-9'"

which I am assuming is the same as

[EpistryNumber]='999999-9'

Yet no record is produced in the subsequent form.

Wayne Morgan said:
stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
'add the following line here
Debug.Print stLinkCriteria
DoCmd.OpenForm stDocName, , , stLinkCriteria

This will put the value of stLinkCriteria into the debug window. It should
look like

[EpistryNumber]='123456-1'

Verify that is what you get.

--
Wayne Morgan
MS Access MVP


Paul B. said:
I can't figure out what is wrong with this. Any ideas would be appreciated.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDataReview"

stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


The Epistry Number is 123456-1 format. I know an entry exists for the one
I
am testing, but the form comes up blank.


Cheers
 
W

Wayne Morgan

If you typed in exactly what I had, you should NOT get the full line as you
have indicated. You should only get the value of stLinkCriteria printed to
the Immediate window. Please copy and paste your code form the procedure
into a message.

--
Wayne Morgan
MS Access MVP


Paul B. said:
Wayne,

I get the following

stLinkCriteria = "[EpistryNumber]='999999-9'"

which I am assuming is the same as

[EpistryNumber]='999999-9'

Yet no record is produced in the subsequent form.

Wayne Morgan said:
stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
'add the following line here
Debug.Print stLinkCriteria
DoCmd.OpenForm stDocName, , , stLinkCriteria

This will put the value of stLinkCriteria into the debug window. It
should
look like

[EpistryNumber]='123456-1'

Verify that is what you get.

--
Wayne Morgan
MS Access MVP


Paul B. said:
I can't figure out what is wrong with this. Any ideas would be
appreciated.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDataReview"

stLinkCriteria = "[EpistryNumber]=" & "'" & Me![EpistryNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


The Epistry Number is 123456-1 format. I know an entry exists for the
one
I
am testing, but the form comes up blank.


Cheers
 

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