Re: Putting the Drop Down value in a variable
- From: "Richard T. Edwards" <redwar2006@xxxxxxxxxxx>
- Date: Wed, 21 Mar 2007 11:58:23 -0700
I generally write a function that makes a call to the database and grabs the
name associated to the id:
public function GetNAmeFromId(ByVal Id as integer) as string
Dim sql as String
Din cnstr as String
sql = "Select SiteName from Sites where Site_Id =" & Id
connection code and the rest go here
GetNameFrom Id = Rs.Fields("SiteName").Value
Close rs from here and set rs = nothing
End Function
"Rohan Kapoor" <RohanKapoor@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B9281BAE-BEC1-4C0C-B8B1-BE3DFC285AE6@xxxxxxxxxxxxxxxx
Hi,
I posted a question before and it really helped me to progress in my
project. Now I'm stuck again :( but this time it is a much simpler issue
than
before. I have a total of 4 drop downs which are interconnected with each
other. Each drop down is connected with a datasource which is pulling 3
columns from a table and is displaying only 1 of them (as it is a text
column
that is displayed in the DD and is connected with an ID value column).
I am looking to assign the Text value chosen in the drop down in the
variable. By default the variable is getting the ID value of the selected
field but I want the Text value/other column value.
Sitename = Site.SelectedValue where Sitename is the variable, Site is the
drop down. This is giving me the Site ID but I want the Site name.
Also this DD is bound by a DataSource selecting 3 fields from the Site
table
and the drop down's DataTextField is SiteName and DataValueField is
SiteId.
I would really appreciate your reply.
Thanks,
Rohan
.
- Prev by Date: Re: Problem with writing data to table with VBA
- Next by Date: Re: Knowledge management system
- Previous by thread: Re: better implementation of sql single quote escape
- Next by thread: Re: Knowledge management system
- Index(es):
Relevant Pages
|