select record and display details on another form

  • Thread starter new2access via AccessMonster.com
  • Start date
N

new2access via AccessMonster.com

well, i have this macro on my sub form on my onClick Event:

CONDITION ACTION ARGUMENTS

IsNull([TSID]) Beep
Not IsNull([TSID]) OpenForm Training Sessions by TSID, Form, , ="
[TSID]=" & [TSID], , Normal

ACTION ARGUMENTS
Form Name: Training Sessions by TSID
View: Form
Where Condition: ="[TSID]=" & [TSID]
Window Mode: Normal


This code works on my Trainees table. What it does is when you click a
certain TraineeID (TraineeID based on Trainees table) it will open up a form
and will display the details of that selected record.

Then I used the above code on my Training Sessions form. When i click on TSID
(hyperlinked) it opens the form Training Sessions by TSID and on that form i
have a subform that should display the details of that particular TSID. It
opens the form BUT it display ALL records (all TSIDs) from the Training
Sessions table instead of showing ONLY that particular TSID.

Note:
TSID: Primary Key
Data Type: Text

Please help. thanks!
 
K

Klatuu

Have you set the Link Master Fields and Link Child Fields properties of the
subform control? It sounds like you have not. What field or fields relate
the recordsets of the main and subforms?
 
G

ghostman via AccessMonster.com

i made it working but the problem now is when i click on each record
(clicking on the hyperlinked TSID field), it asks me to input parameter value.
..either i put a value or not, it displays all the records..

Ex. i clicked 101-MAS-26-08

it shows like this:
TSID ModuleName SessionDate EmpName [some details...]
101-LVR-11-08 Furniture 101 8/11/2009 John
101-LVR-11-08 Furniture 101 8/11/2009 Ray
101-LVR-11-08 Furniture 101 8/11/2009 Susan
101-MAS-26-08 Janitorial 101 8/13/2009 Max

it should display only the details of that specific record a click just like
this:

TSID ModuleName SessionDate EmpName [some details...]
101-MAS-26-08 Janitorial 101 8/13/2009 Max


here's the SQL of my query...(i didn't touched it)

SELECT [Training Sessions].TSID, [Training Sessions].ModuleName, [Training
Sessions].SessionDate, [Training Sessions].SessionTimeFrom, [Training
Sessions].SessionTimeTo, [Training Sessions].SessionVenue, [Training Sessions]
.InstructorID, [Training Record].TraineeID, [Training Record].NoShow
FROM [Training Sessions] INNER JOIN [Training Record] ON [Training Sessions].
TSID = [Training Record].TSID;

how can i make it display the selected TSID?

by the way, the query is based on 2 tables:
1) Training Sessions
- TSID (Text, Primary Key)
- ModuleName
- SessionDate
- SessionTimeFrom
- SessionTimeTo
- SessionVenue
- InstructorID
- TraineeID

2) Training Record
- ID (autonumber)
- TSID (text)
- TrainingID
- NoShow




Have you set the Link Master Fields and Link Child Fields properties of the
subform control? It sounds like you have not. What field or fields relate
the recordsets of the main and subforms?
well, i have this macro on my sub form on my onClick Event:
[quoted text clipped - 25 lines]
Please help. thanks!
 

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

Yes/No 7
Report 3
relationship - query 2
count record 6
count record on subform 0
Count YES/NO Field 2
DCOUNT 11
query / combo box 14

Top