Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2010
    Posts
    57
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Remove Selected Value from a Dropdownlist?

    Hi All,

    I have a dropdown field with multiple date values. I would like to delete or disable the value from the dropdownlist once a user selects a
    date so that only one person gets to choose a particular day.

    Any ideas how to do this? Thanks

    Vinamr

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,496 Times in 4,460 Posts
    Just for starters, what does your database look like? How/where would you store the chosen dates? What does the code look like that creates the <select>?

    You have not given us anything to work from. To try to answer you with what you gave would require a mindreader.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Apr 2010
    Posts
    57
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Hi Pedant,

    Sorry for the delay in attaching the code. The selected field is a dropdown and values are from a lookup table. Once a date is selected I want the date removed from the dropdown list. I was told that a filter works in this case. Not sure how to add one. Thanks.

    Code:
    			' Biksha_Offer
    			If My_Registrations.Biksha_Offer.CurrentValue & "" <> "" Then
    				sFilterWrk = "[Bhiksha_Dates] = '" & ew_AdjustSql(My_Registrations.Biksha_Offer.CurrentValue) & "'"
    			sSqlWrk = "SELECT [Bhiksha_Dates] FROM [dbo].[CM_Bhiksha_Dates]"
    			sWhereWrk = ""
    			Call ew_AddFilter(sWhereWrk, sFilterWrk)
    			If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
    				Set RsWrk = Conn.Execute(sSqlWrk)
    				If Not RsWrk.Eof Then
    					My_Registrations.Biksha_Offer.ViewValue = RsWrk("Bhiksha_Dates")
    				Else
    					My_Registrations.Biksha_Offer.ViewValue = My_Registrations.Biksha_Offer.CurrentValue
    				End If
    				RsWrk.Close
    				Set RsWrk = Nothing
    			Else
    				My_Registrations.Biksha_Offer.ViewValue = Null
    			End If
    			My_Registrations.Biksha_Offer.ViewCustomAttributes = ""


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •