dyanmic Form

Results 1 to 2 of 2

Thread: dyanmic Form

  1. #1
    Join Date
    Dec 1969

    Default dyanmic Form

    I am makinng a dynamic form from fb the field name of the form are column name of a table in db while what ever users will type in the box the form will go and do a search on the basis of that where clause...<BR>so my sql will be like this....where field1="value1" and field2="value2"....my problem is it is working fine if I type in all the form fields but if i am passing in a blank value something like...<BR>field1="value1" and field2="" then it blows up <BR>how can i get rid of the ,and field2="", if a field is balnk and just pass only those fiels which has values.....<BR>my code is like this<BR><BR>&#060;%<BR> search_clause=search_field(0)&"=&#039;"&(trim(sear ch_value(0)))&"&#039;"<BR> for x=1 to ubound(search_field) <BR> if search_value(x) &#060;&#062; "" then <BR> search_clause= search_clause & " AND " & search_field(x)&"=&#039;"&(trim(search_value(x)))& "&#039;" <BR> strSrchClause = search_clause<BR> <BR> end if <BR> next <BR>%&#062;<BR>any help tahnks

  2. #2
    Join Date
    Dec 1969

    Default RE: dyanmic Form

    Do a loop...<BR><BR>For i = 0 to Whatever<BR> If yourelement &#060;&#062; "" Then<BR> yourvar = yourvar & ", " & yourelement<BR> End If<BR>Next<BR><BR>Obviously, play with this a bit to get your field names in there also, but this should get you started.

Posting Permissions

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