Friday, February 24, 2012

CountyLong Name and County Short Name

Hello, i have database front end is Access, and backend is sql server. The front end, there are two dropbox, called 'CountyLongName', and 'CountyShortName'. I want to: when i select a countyLongName, there it will pop up the exact CountyShortName in anohter field.

For example, when i click Howard Couty in the 'CountyLongNmae', it will automatically display "HW" in the 'CountyShortName" Field. How can i do that? Thanks.More of an Access question than an SQL question. Also, more of a front-end question than a db question.

That said, the drop-down list has an event called OnChange. In the code for that event, will be something like:

text1.Value = lkpCountyShortName.Column(1)

You must define the query for the lkpCountyShortName to include 2 columns, the first being the short name and the second being the long name.

Regards,

hmscott

Hello, i have database front end is Access, and backend is sql server. The front end, there are two dropbox, called 'CountyLongName', and 'CountyShortName'. I want to: when i select a countyLongName, there it will pop up the exact CountyShortName in anohter field.

For example, when i click Howard Couty in the 'CountyLongNmae', it will automatically display "HW" in the 'CountyShortName" Field. How can i do that? Thanks.|||I usually Dim an array that contains the CountyShortName and populate it in the same loop where I populate the drop-down list. This way the subscript value for each combobox element is the same as the array subscript.

txtShortName.Text = ShortNames_A(cmbLongNames.ListIndex)|||Thanks your guy still remembered me. Last time the backup problem made me crazy. Fortunately everything was recovered.
Do you have any code I can reference,thanks in advance. I am not familar with VBA. I have counties,

Allegany AL
Anne Arundel AA
Baltimore City BC
Baltimore County BA
Calvert CV
Caroline CA
Carroll CR
Cecil CE
Charles CH
Dorchester DO
Frederick FR
Garrett GA
Harford HA
Howard HO
Kent KE
Montgomery MO
Prince George PG
Queen Anne QA
Saint Mary SM
Somerset SO
Talbot TA
Washington WA
Wicomico WI
Worcester -- WO|||Make the Datasource look like

SELECT CountyLongName + ' - ' + CountyShortName FROM yourTable

?????|||I am so sorry, i am still can't figure out how to do it. Can you guy give me more detail. Now i already have a file call "CountyLongName" and CountyShortName". Thanks again!

No comments:

Post a Comment