My bad. Yes, stand-alone labels have a few events, including Click and Dbl Click.
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
(Paris, France)
"Stand-alone" labels are the only ones that have events associated with them. Associated label controls pass the events to the parent control.
Duane Hookom, MVP
MS Access
To:
MS_Access_Professionals@yahoogroups.comFrom:
MS_Access_Professionals@yahoogroups.comDate: Tue, 24 Mar 2015 15:23:46 +0100
Subject: Re: [MS_AccessPros] VBA code to call specific record in a form
Duane-
Yes, that's true, but Afiqah implied these are just stand-alone labels. And when a label is associated, clicking it fires the click event of the attached control, not the label.
John,
I thought label controls that are not the child of another control can click, double-click, and mouse events.
I would try to avoid hard-coding model names as label captions on a form. This would mean having to change form designs as you add or remove models.
Duane Hookom, MVP
MS Access
From:
MS_Access_Professionals@yahoogroups.com Afiqah-
Label controls don't have any events, so I don't see how you're going to make this work. Why not use Command Buttons and the Click event? In the respective events, use DoCmd.OpenForm with a filter specified in the WhereCondition parameter to display the record.
Hi,
I'm using Ms Access 2007.
Currently, I have designed a form (frmHome) consist of 10 labels which I named it lblFordFiesta, lblFordFocus, and etc.
I would like the user to open another form named frmmodelspecification that display Ford Fiesta record (display all fields) when the user click on lblFordFiesta and display Ford Focus record (display all fields) when the user click on lblFordFocus.
Ford Fiesta and Ford Focus records are stored in tblmodelspecification and consist of 37 fields. frmmodelspecification is created based on tblmodelspecification table while frmHome is created and categorized as unrelated objects.
Hope you can guide me to write VBA code for this event.
Thanks in advance!
Regards,
Afiqah
Tidak ada komentar:
Posting Komentar