Filter Frustration

  • Thread starter Thread starter hntsignif
  • Start date Start date
H

hntsignif

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.
 
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
 
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 said:
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 said:
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.
 
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?
 
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 said:
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 said:
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.
 
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 said:
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 said:
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 said:
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.
 
Finally found the issue. I hadn't added the second table to the called
subform's SQL statement.
 
Back
Top