Ahmed-
The Record Source for your subform could be something like:
SELECT m_id, StatusID FROM Detail WHERE StatusID = DMax("StatusID",
"Detail", "m_id = " & [m_id])
You could also do it with a Subquery, but then Access would mark the query
not updatable.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of cyberonpk
Sent: Thursday, September 12, 2013 6:54 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Subform to show last entered record or show Maximum
of ID
Dear All,
I've a Master form with subform in it, they are linked (one-to-many
relation) with fields as normally we do.User can make entries through this
form and it is working fine. Following is the structure of tables which
Master/Detail form based on:
Master:
m_id (Primary Key Autonumber)
compID (Number)
DateRecvd: (Date/Time)
Detail:
m_id (Foreign Key Number)
StatusID (Number)
User makes entry for Company (compID) in Master Part, and enter Status (1 to
8) in different intervals, for e.g. User makes new entry for Company ID 1
and DateRecvd 09-09-2013 and enter Status 1, next day when user received
updates for particular Company he search for that record for Company ID 1
and enter Status 2 and so on till Status reach to 8.
Now the problem, what I need is when user search or navigate through
records, the Subform needs to show only last entered Status, example: if
user previously entered 1 and 2 and he searches for the record then the form
should show only 2, he then enters 3, next time when he searches the record
subform should show 3 and so on.
Is there anyway to do it? I've tried to make query for subform datasource
and use Max function for StatusID but it turns out using aggregate function
makes subform read-only.
Looking forward to receive expert advises as always.
Thanks
Ahmed
------------------------------------
Yahoo! Groups Links
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar