From: Daryl S on
What do you see with the debug.print statements? (They will be in the
immediate window when you run the code.) They will show you what is being
passed in - post the results for each here.

--
Daryl S


"hntsignif" wrote:

> 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.
From: hntsignif on
Finally found the issue. I hadn't added the second table to the called
subform's SQL statement.

"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.
First  |  Prev  | 
Pages: 1 2
Prev: IIf statement sometimes works
Next: Data Refresh