Links to records

C

Caroline

Hello,
I am trying to link the case numbers (in a table or form) to the case detail
form, going directly to that case number instead of the begining of the form.
How do I do that?
Thank you,
Caroline
 
B

Beetle

You should have a relationship between the two tables based
on the Case number (assuming that is the PK value). Then you
would typically use a form/sub form arrangement where the
main form is based on the Case table and the sub form is based
on the Case Detail table, using CaseNumber as the Master/Child
link.
 
C

Caroline

Thank you. Sorry, I was too brief.
I am using the "issue tracking" template as my example -but I'm starting
from scratch because I don't want everything the template has.
I have a case table, with the associated form, "case details". I also have a
client table (with a relationship to the case table); I have a form based on
the client table. In that form, I have all the cases related to a particular
client. I want those cases to display a link that, when clicked, would get me
to the "Case details" form -to the right case number.
 
B

Beetle

OK. You can use the Where argument of the OpenForm method.

On the sub form that shows all the Cases for a particular Client
you could have, for example, a command button with code like
the following;

Private Sub cmdDetails_Click ()

DoCmd.OpenForm "frmCaseDetails", , , "CaseNumber=" & Me![CaseNumber]

End Sub

The above assumes that CaseNumber is an integer. If it is text
you will need to add additional quote delimiters like;

DoCmd.OpenForm "frmCaseDetails", , , "CaseNumber=""" & _
Me![CaseNumber] & """"

That's three double qoutes after the = sign and four double
quotes at the end. I have added the continuation character
(the underscore) because of the newsgroup line wrap.

If you're not that familiar with code, the command button
wizard can guide you through the process.
 

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

"On click" problem 8
Conditional format duplicates 1
"On click" problem 5
Pop up window /form 2
RunCommand in disabled mode 4
Subform view as form not datasheet 2
Form field list 2
Form/Scroll bar 2

Top