cannot filter continuous form data

D

DubboPete

Hi all,

On a continuous form, I have a command button that opens up a new form
with the linked data from the previous form. So it appears next to
every record, with the purpose of filtering that record and displaying
it on the subsequent form in muchh greater detail. Except it's only
ever opening up the first record in the table, not the one that's
linked...

Any clues anyone?

Here's the code:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FrmCallContacts2"

stLinkCriteria = "[CallID]=" & Me![CallID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

thanks in anticipation everyone!

Pete
 
J

Jeanette Cunningham

That often means that the CallID on the continuous form can't be found in
the record source for the linked form.
Check the record source for the linked form, see if it has the correct
query.
You can also debug your code to see what value for CallID is being picked up
from the coninuous form - perhaps it is finding Null for CallID.
This would also make the linked form open at the first record.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

DubboPete

That often means that the CallID on the continuous form can't be found in
the record source for the linked form.
Check the record source for the linked form, see if it has the correct
query.
You can also debug your code to see what value for CallID is being pickedup
from the coninuous form - perhaps it is finding Null for CallID.
This would also make the linked form open at the first record.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




On a continuous form, I have a command button that opens up a new form
with the linked data from the previous form.   So it appears next to
every record, with the purpose of filtering that record and displaying
it on the subsequent form in muchh greater detail.   Except it's only
ever opening up the first record in the table, not the one that's
linked...
Any clues anyone?
Here's the code:
   Dim stDocName As String
   Dim stLinkCriteria As String
   stDocName = "FrmCallContacts2"
   stLinkCriteria = "[CallID]=" & Me![CallID]
   DoCmd.OpenForm stDocName, , , stLinkCriteria
thanks in anticipation everyone!
Pete- Hide quoted text -

- Show quoted text -

Thanks Jeanette

Couldn't get it to fwork no matter what, so I built a new command
button, and that worked!
Dontcha just love this Access?

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

fomr opens to wrong record 5
Inserting data in forms 1
Remove filter 4
Data Entry = No 6
Code error when opening a form 2
can't find form 4
Form not populating 4
Using a wildcard to open a form 2

Top