Senin, 23 Juli 2012

Re: RE: [AccessDevelopers] Dynamic Combo Box

 

I think it doesnt work in Access Project....
What about if the database in MS SQLSERVER?


Sent from Yahoo! Mail on Android



From: Toby Bierly <toby@stahlbush.com>;
To: AccessDevelopers@yahoogroups.com <AccessDevelopers@yahoogroups.com>;
Subject: RE: [AccessDevelopers] Dynamic Combo Box
Sent: Wed, Feb 15, 2012 6:34:41 PM

 

Exactly what Duane said, but here's a little more detail.
 
Go to the Properties for the combo box, Data tab.  The Row Source for the combo box (hit the ... button and it will take you to the query design window) needs to have the text box in the criteria.
 
To refer to the text box, use something like this:
Forms!FormName!TextBoxName
 
You'll end up with the rowsource for the combobox looking something like this once back in the properties window:
SELECT DataFieldName FROM TableName WHERE FilterFieldName=Forms!FormName!TextBoxName;
 
Then, to Requery the combo box, put something like this in the AfterUpdate Event of the text box:
 
Private Sub TextBoxName_AfterUpdate()
    ComboBoxName.Requery
End Sub
 
Then, each time you change/update the text box, the combo box will re-run the rowsource query which filters based on the text box value.
 
Hope that helps,
Toby
 
-----Original Message-----
From: AccessDevelopers@yahoogroups.com [mailto:AccessDevelopers@yahoogroups.com] On Behalf Of Duane Hookom
Sent: Wednesday, February 15, 2012 9:54 AM
To: access developers
Subject: RE: [AccessDevelopers] Dynamic Combo Box

 

Change the Row Source of the combo box to filter based on the value of the text box. You may need to requery the combo box when moving from record to record and/or updating the text box.
 
If you can't figure this out, reply with:
-Name of the form
-Name of the text box
-SQL view of the combo box Row Source
 
Duane Hookom
MS Access MVP
 

To: AccessDevelopers@yahoogroups.com
From: data_bersama@yahoo.com
Date: Wed, 15 Feb 2012 08:31:09 -0800
Subject: [AccessDevelopers] Dynamic Combo Box

 
Could you tell me how to make a dynamiccombo box base on the text on the same form?
Please give me a code....thanks

Regards,

Agung PS





__._,_.___
Recent Activity:

Please zip all files prior to uploading to Files section.
.

__,_._,___

Tidak ada komentar:

Posting Komentar