Selasa, 24 Maret 2015

RE: [MS_AccessPros] VBA code to call specific record in a form

 

"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.com
From: MS_Access_Professionals@yahoogroups.com
Date: 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 Viescas, Author
On Mar 24, 2015, at 2:26 PM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
 
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.
John Viescas, Author
On Mar 24, 2015, at 2:34 AM, bubbleblue_007@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
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

__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

.

__,_._,___

Tidak ada komentar:

Posting Komentar