B
Barry Claxton
This has been driving me bats for a full week! How can a filter work on SOME
records in a table (in this case dates) but not others in the same table? By
the way I created the database in English for a fishing club of which I'm
secretary. The INTERFACE (and table names) are for a Spanish user but its
programing is English:
I have two forms serving two tables. The table "Registros de Pesca" stores
details/history of each members days of fishing. The table "Datos de
capturas" stores details of fish caught by each fisher. the two forms are
respectively "registros de pesca historia" & "Datos de capturas form"
On the form "registros de pesca historia" each record has a button
"capturas" which when clicked opens the form "Datos de capturas form"
I'm trying to have the "Datos de capturas form" function like a sub form.
i.e it opens with two fields on each form synchronised.
The fields in question (on forms and tables) are;- [Nº REGISTRO] and FECHA
DE EMISIÓN DEL TICKET (On the form "registros de pesca historia") and
Nº_REGISTRO] and TICKET_FECHA_DE_EMISIÓN (on the the form "Datos de capturas
form")
Behind the capturas button the code is as follows:-
Private Sub Capturas_Click()
On Error GoTo Err_Capturas_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Datos de capturas form"
stLinkCriteria = "[Nº_REGISTRO]=" & Me![Nº REGISTRO]
stLinkCriteria = "[TICKET_FECHA_DE_EMISIÓN]=" & "#" & Me![FECHA DE
EMISIÓN DEL TICKET] & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Capturas_Click:
Exit Sub
Err_Capturas_Click:
MsgBox Err.Description
Resume Exit_Capturas_Click
End Sub
Now, two things, the program only appears to be seeing the reference to the
Fecha de emision fields, BUT here's what is really perplexing me,
When I display the Registros de pesca form for (say) member 1115, his 12
different days of fishing are displayed. Now, if i click on th capturas
button on each record in turn, SOME of the capturas details in the capturas
form display, synchronised accordingly. However, SOME do not! The amazing
thing is, the filtering (created by the above procedure) is the same, or
that's to say correct, for each record
e.g. in the "Data" properties opposite "filter" for the capturas form
appears [TICKET_FECHA_DE_EMISIÓN]=#26/01/2009#
correct for that form and displaying correctly. However, another record
(with a different date) from this member 1115 after clicking capturas
displays the two fields on it blank (no data), DESPITE the filter being there
and being correct! (e.g. [TICKET_FECHA_DE_EMISIÓN]=#03/06/2008#)
How can it be that the same code sets up the same filter and yet some
records show and others dont !!! The underlying data is the same for each
record in the tables!
Anyone help me with this?
records in a table (in this case dates) but not others in the same table? By
the way I created the database in English for a fishing club of which I'm
secretary. The INTERFACE (and table names) are for a Spanish user but its
programing is English:
I have two forms serving two tables. The table "Registros de Pesca" stores
details/history of each members days of fishing. The table "Datos de
capturas" stores details of fish caught by each fisher. the two forms are
respectively "registros de pesca historia" & "Datos de capturas form"
On the form "registros de pesca historia" each record has a button
"capturas" which when clicked opens the form "Datos de capturas form"
I'm trying to have the "Datos de capturas form" function like a sub form.
i.e it opens with two fields on each form synchronised.
The fields in question (on forms and tables) are;- [Nº REGISTRO] and FECHA
DE EMISIÓN DEL TICKET (On the form "registros de pesca historia") and
Nº_REGISTRO] and TICKET_FECHA_DE_EMISIÓN (on the the form "Datos de capturas
form")
Behind the capturas button the code is as follows:-
Private Sub Capturas_Click()
On Error GoTo Err_Capturas_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Datos de capturas form"
stLinkCriteria = "[Nº_REGISTRO]=" & Me![Nº REGISTRO]
stLinkCriteria = "[TICKET_FECHA_DE_EMISIÓN]=" & "#" & Me![FECHA DE
EMISIÓN DEL TICKET] & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Capturas_Click:
Exit Sub
Err_Capturas_Click:
MsgBox Err.Description
Resume Exit_Capturas_Click
End Sub
Now, two things, the program only appears to be seeing the reference to the
Fecha de emision fields, BUT here's what is really perplexing me,
When I display the Registros de pesca form for (say) member 1115, his 12
different days of fishing are displayed. Now, if i click on th capturas
button on each record in turn, SOME of the capturas details in the capturas
form display, synchronised accordingly. However, SOME do not! The amazing
thing is, the filtering (created by the above procedure) is the same, or
that's to say correct, for each record
e.g. in the "Data" properties opposite "filter" for the capturas form
appears [TICKET_FECHA_DE_EMISIÓN]=#26/01/2009#
correct for that form and displaying correctly. However, another record
(with a different date) from this member 1115 after clicking capturas
displays the two fields on it blank (no data), DESPITE the filter being there
and being correct! (e.g. [TICKET_FECHA_DE_EMISIÓN]=#03/06/2008#)
How can it be that the same code sets up the same filter and yet some
records show and others dont !!! The underlying data is the same for each
record in the tables!
Anyone help me with this?