From: hntsignif on
I have two forms. Both have a button that call the same subform.

This is the information for the first call. It works just fine.
________________________________________
stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
Me!DEVCODE & "'"
stDocName = "MilestoneDates"
DoCmd.OpenForm stDocName, , , stLinkCriteria
________________________________________

This is the information for the second call. The Seasons portion works but
the TrackingNo portion doesn't (Ie I pulled the code and ran one part and
then the other)
________________________________________
stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
Me!TrackingNo & "'"
stDocName = "MilestoneDates"
DoCmd.OpenForm stDocName, , , stLinkCriteria
________________________________________

The type (Text), format (none specified), information (indexed, no
duplicates) and even number of characters (255) is all the same between the
DEVCODE field and the TrackingNo field. They are in two different tables.

Why would one work and not the other??? It is driving me nuts.
From: Danny on
Should the criteria string in the second form read like this:

stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [TrackingNo]='" &
Me!TrackingNo & "'"

I replaced [DevCodeA] with [TrackingNo]...

Danny

"hntsignif" wrote:

> I have two forms. Both have a button that call the same subform.
>
> This is the information for the first call. It works just fine.
> ________________________________________
> stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> Me!DEVCODE & "'"
> stDocName = "MilestoneDates"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> ________________________________________
>
> This is the information for the second call. The Seasons portion works but
> the TrackingNo portion doesn't (Ie I pulled the code and ran one part and
> then the other)
> ________________________________________
> stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> Me!TrackingNo & "'"
> stDocName = "MilestoneDates"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> ________________________________________
>
> The type (Text), format (none specified), information (indexed, no
> duplicates) and even number of characters (255) is all the same between the
> DEVCODE field and the TrackingNo field. They are in two different tables.
>
> Why would one work and not the other??? It is driving me nuts.
From: hntsignif on
No [DevCodeA] and [SEASONS] are the fields on the form I am opening. It is
the same form as the one opened in in the first example. The only thing that
changes is that the second form I am drawing from has the name of the field
changed in order to separate the tables. The first example is from the table
Inline and the second is associated with the table MarcomPackaging.

"Danny" wrote:

> Should the criteria string in the second form read like this:
>
> stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [TrackingNo]='" &
> Me!TrackingNo & "'"
>
> I replaced [DevCodeA] with [TrackingNo]...
>
> Danny
>
> "hntsignif" wrote:
>
> > I have two forms. Both have a button that call the same subform.
> >
> > This is the information for the first call. It works just fine.
> > ________________________________________
> > stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> > Me!DEVCODE & "'"
> > stDocName = "MilestoneDates"
> > DoCmd.OpenForm stDocName, , , stLinkCriteria
> > ________________________________________
> >
> > This is the information for the second call. The Seasons portion works but
> > the TrackingNo portion doesn't (Ie I pulled the code and ran one part and
> > then the other)
> > ________________________________________
> > stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> > Me!TrackingNo & "'"
> > stDocName = "MilestoneDates"
> > DoCmd.OpenForm stDocName, , , stLinkCriteria
> > ________________________________________
> >
> > The type (Text), format (none specified), information (indexed, no
> > duplicates) and even number of characters (255) is all the same between the
> > DEVCODE field and the TrackingNo field. They are in two different tables.
> >
> > Why would one work and not the other??? It is driving me nuts.
From: Daryl S on
I don't see an issue - why don't you put a
debug.print stLinkCriteria
in each before the DoCmd statement, and see what it shows as you step
through the code?

Is there anything different about the controls on the forms that hold the
values?

--
Daryl S


"hntsignif" wrote:

> I have two forms. Both have a button that call the same subform.
>
> This is the information for the first call. It works just fine.
> ________________________________________
> stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> Me!DEVCODE & "'"
> stDocName = "MilestoneDates"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> ________________________________________
>
> This is the information for the second call. The Seasons portion works but
> the TrackingNo portion doesn't (Ie I pulled the code and ran one part and
> then the other)
> ________________________________________
> stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> Me!TrackingNo & "'"
> stDocName = "MilestoneDates"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
> ________________________________________
>
> The type (Text), format (none specified), information (indexed, no
> duplicates) and even number of characters (255) is all the same between the
> DEVCODE field and the TrackingNo field. They are in two different tables.
>
> Why would one work and not the other??? It is driving me nuts.
From: hntsignif on
No, no difference. As a matter of fact the second form started out as a copy
of the first form and I just changed the source to the new table and adjusted
the fields and codes accordingly.

I will give the debug idea a try.

"Daryl S" wrote:

> I don't see an issue - why don't you put a
> debug.print stLinkCriteria
> in each before the DoCmd statement, and see what it shows as you step
> through the code?
>
> Is there anything different about the controls on the forms that hold the
> values?
>
> --
> Daryl S
>
>
> "hntsignif" wrote:
>
> > I have two forms. Both have a button that call the same subform.
> >
> > This is the information for the first call. It works just fine.
> > ________________________________________
> > stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> > Me!DEVCODE & "'"
> > stDocName = "MilestoneDates"
> > DoCmd.OpenForm stDocName, , , stLinkCriteria
> > ________________________________________
> >
> > This is the information for the second call. The Seasons portion works but
> > the TrackingNo portion doesn't (Ie I pulled the code and ran one part and
> > then the other)
> > ________________________________________
> > stLinkCriteria = "[SEASONS]='" & Me!Season & "' And [DevCodeA]='" &
> > Me!TrackingNo & "'"
> > stDocName = "MilestoneDates"
> > DoCmd.OpenForm stDocName, , , stLinkCriteria
> > ________________________________________
> >
> > The type (Text), format (none specified), information (indexed, no
> > duplicates) and even number of characters (255) is all the same between the
> > DEVCODE field and the TrackingNo field. They are in two different tables.
> >
> > Why would one work and not the other??? It is driving me nuts.
 |  Next  |  Last
Pages: 1 2
Prev: IIf statement sometimes works
Next: Data Refresh