Need help with String

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top