Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Using DLookUp in continuous form (multiple records)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Krzysztof Bartosiewicz - 30 Apr 2005 15:30 GMT
Hi!
I have a subform of a form which view is continuous - it shows many records
at once. I tried to use an editbox which should be somehow filled with a
text from a query. I created a query

SELECT [Medicines].[ID_MEDICINE], [Medicines].[MedicineName],
[MedicineGroups].[MedicineGroupName]
FROM Medicines, MedicineGroups
WHERE Medicines.ID_MEDICINEGROUP = MedicineGroups.ID_MEDICINEGROUP;

and I tried something like

=DLookUp("MedicineGroupName";"[Query_Medicines]";"Medicines.ID_MEDICINE=" &
[ID_MEDICINE])

The problem is that the value of the field is calculated calculated once and
all records have the same value in the edit box no matter what ID.MEDICINE
is (all fields have the value connected with the ID.MEDICINE of the 1st
record)

Is there any way to fix this problem? Maybe I should use some VBA code to
force MS Access to calculate the value in EACH record separately basing on
the value of ID_MEDICINE field in that record..
But which event should I use and what code should be placed there? Maybe
some refreshing or somthing?

Thanks in advance for help
Chris Bartosiewicz
Krzysztof Bartosiewicz - 30 Apr 2005 19:00 GMT
Hmm.. It's not a problem any more :)

I struggled with that problem for a while and after I send the mail to the
newsgroup I realised how simple it was..

The entry:
=DLookUp("MedicineGroupName";"[Query_Medicines]";"Medicines.ID_MEDICINE="
&[ID_MEDICINE])
was cerrect but I used it in default value instead of the source...

Sorry for bothering you..
Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.