Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Creating a find button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Creating a find button

    I have a table with several fields, the first are First_Name, Middle_Initial, Last_Name,Date_of_Birth, SS#. I would like to create 3 buttons that search for and find all items that match. For example I would enter Smith, Thomas and all those that match come up in a list. This would be dynamic, in that the list would get smaller as enter more characters. I could then click on the correct Thomas Smith and cring up that file in the window. The same with the other fields. Any help here?

    #2
    Re: Creating a find button

    Try searching on progressive lookup.
    There can be only one.

    Comment


      #3
      Re: Creating a find button

      You could do this in any number of ways, but I prefer using an xdialog box to enter the fields, then display a list of "matching" records to select from. We actualy have something similar for our customer information system. we can search on any number of criteria. I've attached examples of the input dialogs, (last name, First and last name, First , last, and DOB, and Initial, last, dob) and a sample of the result dialog. I needed to erase critical client information so pardon the sloppy look of the result.

      I can send you the code if it will help.

      You would need to tailor it to your table and field names.

      Tom

      Comment


        #4
        Re: Creating a find button

        As a newbie if you could send the code I would much appreciate it. Thank you.

        Comment


          #5
          Re: Creating a find button

          This isn't for the faint of heart. I'll tell you up front, the code is a bit intricate, but if you take your time and read through it, you will see how it works. I initially used the script genie to create the shell of the dialog, but then I needed to "tweak" it a bit.

          Code:
          'Date Created: 04-May-2007 03:32:36 PM
          'Last Updated: 02-Jul-2008 01:01:23 PM
          'Created By  :
          'Updated By  : 
          retry1:
          dim aa as P
          aa = addin.variables()
          DIM SHARED search_by as C
          DIM SHARED varC_result as C
          Dim Shared SSNN as C
          Dim shared Caseno as C
          Dim SHARED FNAME as C
          Dim Shared LName as C
          Dim Shared DOB as D
          Dim SHARED FLNAME as C
          Dim wordct as N
          SSNN = ""
          Caseno = ""
          FNAME = ""
          LName = ""
          search_by=""
          '*****************
          'initialize dob
          'added by hubert
          dob={}
          '*****************
          tbl = table.current()
          ok_button_label = "&OK"
          cancel_button_label = "&Cancel"
          varC_result = ui_dlg_box("Client Search",<<%dlg%
          {region}Please Select Search Type:{endRegion};
          {region}
          (search_by:Case!radio2_)|
          (search_by:SSN!radio1_);
          {condition=(tbl.name_get()<>"Link")}
          (search_by:Last Name!radio4_)|
          (search_by:Full Name!radio3_)|(search_by:Last, First, DOB!radio7_);
          (search_by:Last Name 1st Initial!radio5_)|
          (search_by:Investigations!radio6_);
          {condition=.T.}
          {endregion};
          {condition=(search_by="SSN")}
          {region=a}
          {LF}; 
          Please Enter Client's SSN:| [.20SSNN];
          {endregion}
          {condition=(search_by="Case")}
          {start_pos}
          {region=a}
          {LF};
          Please Enter Client's Case #:| [.15Caseno];
          {endregion}
          {condition=(search_by="Last Name")}
          {start_pos}
          {region=a}
          {LF};
          Please Enter Client's Last Name:|[.25LName];
          {endregion}
          {condition=(search_by="Full Name")}
          {start_pos}
          {region=a}
          {LF};
          Please Enter Client's First Name:|[.20FNAME];
          Please Enter Client's Last Name:|[.25LName];
          {endregion}
          {condition=(search_by="Last Name 1st Initial")}
          {start_pos}
          {region=a}
          {LF};
          Please Enter Client's First Initial:|[.2INT];
          Please Enter Client's Last Name:|[.25LName];
          Please Enter Client's Date of Birth:|[%DATE%.15DOB]   - Optional;
          {endregion}
          {condition=(search_by="Last, First, DOB")}
          {start_pos}
          {region=a}
          Please Enter Client's First Name:|[.20FNAME1];
          Please Enter Client's Last Name:|[.25LName];
          Please Enter Client's Date of Birth:|[%DATE%.15DOB];
          {endregion}
          {condition=(search_by="Investigations")}
          {start_pos}
          {region=a}
          Please Enter Client's Street Address:|[.30ADDR];
          Please Enter Client's City:|[.25CITY];
          Please Enter Client's State|[.4STATE];
          {endregion};
          {condition=.T.}
          {line=1,0};
          {region}
          <*15=ok_button_label!OK?.not.(search_by="")> <15=cancel_button_label!CANCEL>
          {endregion};
          %dlg%,<<%code%
          if left(a_dlg_button,7) = "radio1_" then
             ui_dlg_ctl_goto("Client Search","SSNN")
             a_dlg_button=""
          end if
          if left(a_dlg_button,7) = "radio2_" then
             ui_dlg_ctl_goto("Client Search","Caseno")
             a_dlg_button=""
          end if
          if left(a_dlg_button,7) = "radio3_" then
             ui_dlg_ctl_goto("Client Search","FNAME")
             a_dlg_button=""
          end if
          if left(a_dlg_button,7) = "radio4_" then
             ui_dlg_ctl_goto("Client Search","LNAME")
             a_dlg_button=""
          end if
          if left(a_dlg_button,7) = "radio5_" then
             ui_dlg_ctl_goto("Client Search","INT")
             a_dlg_button=""
          end if
          if left(a_dlg_button,7) = "radio6_" then
             ui_dlg_ctl_goto("Client Search","ADDR")
             a_dlg_button=""
          end if
          if left(a_dlg_button,7) = "radio7_" then
             ui_dlg_ctl_goto("Client Search","FNAME1")
             a_dlg_button=""
          end if
          %code%)
          if varC_result= "CANCEL"
          	ui_msg_box(Agency+" Client Search","Action Cancelled at user request")
          	end
          end if
          debugcheck()
          if search_by="Case"
          	if tbl.name_get() = "Client"
          		'this is the Client Set, get the ssn from the link table
          		tbl2 = table.open("link")
          		tbl2.index_primary_put("case")
          		rec = tbl2.fetch_find(padr(ut(caseno),12," "))
          		dim casenod as C
          		casenod = ""
          		if rec <1
          			tbl2.index_primary_put("last6")
          			rec = tbl2.fetch_find(right(trim(caseno),6))
          			if rec <1
          				ui_msg_box(agency+" Client Search","Case Number "+ut(caseno)+" does not exist in Client Information"+chr(13)+"Please check the case # entered and retry")
          				goto retry1
          			end if
          		end if
          		ssnn = tbl2.ssn
          		if ut(tbl2.Case)<>ut(caseno)
          			casenod=tbl2.case
          		  else
          		  	casenod = ut(caseno)
          		end if
          		tbl2.close()
          		ui_msg_box(agency+" Client Search","A Client exists for Case Number "+ut(casenod)+chr(13)+"Please verify that this is the Client you are looking for")
          		goto checksoc
          	end if	
          	
          	indx_2 = tbl.index_primary_put("last6")
          	'fetch_first(db_current())
          	rec = tbl.fetch_find(right(trim(caseno),6))
          	if rec > 0
          		parentform.resynch()
          		UI_MSG_BOX(agency+" - FIND","This is the FIRST CASE with this Number "+Upper(link->case)+chr(13)+"If this is not the one you need, hit "+chr(39)+"Page Down"+chr(39)+" until you retrieve the right one.",64)
          	  ELSE
          		UI_MSG_BOX(agency+" - FIND","Case Number "+ut(caseno)+" Does NOT exist in the System!"+chr(13)+"Please check the number and try again.",16)
          		goto retry1
          	end if
          	end
          end if	
          if search_by="SSN" then
          checksoc:
          	if len(alltrim(ssnn))<>9 .and. len(alltrim(ssnn))<>11
          		ui_msg_box(agency+" - Find","Length of SSN entered is Invalid.  Please try again.")
          		goto retry1
          	end if
          	soc1=padr(trim(ssnn),13," ")	
          '	'Check to see if this ssn exists in someone elses  household
          '	CLSSN = lookupc("F",left(SOC1,11),"CLSSN","househol.dbf","ssn")
          '		IF CLSSN > "             " THEN
          '			clname = alltrim(lookupc("F",clssn,"FNAME","Client.dbf","ssn"))+" "+trim(lookupc("F",clssn,"lNAME","Client.dbf","ssn"))
          '			UI_MSG_BOX(agency+" - FIND","This person Also exists in the HOUSEHOLD of a Customer by the name of -  "+chr(13)+chr(13)+ut(clname)+chr(13)+chr(13)+"This Customer's Information will be Displayed")
          '			'Soc1 = clssn
          '		end if
          '	'*******************************************************************
          	INDX_1 = tbl.index_primary_put("ssn")
          	rec= tbl.fetch_find(soc1)
          	if rec > 0
          		parentform.resynch()
          		'Check to see if this ssn exists in someone elses  household
          		CLSSN = lookupc("F",left(SOC1,11),"CLSSN","househol.dbf","ssn")
          		IF CLSSN > "             " THEN
          			clname = alltrim(lookupc("F",clssn,"FNAME","Client.dbf","ssn"))+" "+trim(lookupc("F",clssn,"lNAME","Client.dbf","ssn"))
          			ansc =UI_MSG_BOX(agency+" - FIND","This person Also exists in the HOUSEHOLD of a Customer by the name of -  "+chr(13)+chr(13)+ut(clname)+chr(13)+chr(13)+"Do you want to display "+clname+"'s Customer's Information?",52)
          			if ansc = 6
          				Soc1 = clssn
          				tbl.fetch_find(soc1)
          				parentform.Resynch()
          			end if			
          		end if
          		'*******************************************************************
          '		parentform.Refresh_Layout() 
          	  ELSE
          		UI_MSG_BOX(agency+" - FIND","Customer SSN Does NOT exist in Client Info. Checking Medicaid!",16)
          		med_file = TABLE.open(AA.BCBSS.PATH+"\medicaid\medicaid.dbf")
          		MED_FILE.index_primary_put("ssn")
          		FOUND=MED_FILE.fetch_fiND(SOC1)
          		If found > 0 then
          			ans2 = ui_msg_box(agency+" - FIND","A Client with this SSN     "+TRANSFORM(trim(ssn),"@R XXX-XX-XXXXXX")+ chr(13)+"Has been found in the MEDICAID Database "+CHR(13)+"Case Number   "+TRANSFORM(trim(MED_FILE.medicaidno),"@R XX XX XXXXXX")+CHR(13)+" Do you want to see this case?",36)	
          			if ans2 = 6 then
          				'display Medicaid Form
          				dim A_FORM_CURRENT as c
          				query.filter = "SSN = Client->ssn"
          				query.order = ""
          				callother("NEW FORM RETRO VIEW","\medicaid\medicaid.dbf")
          		  	  else
          				ui_msg_box(agency+" - FIND","A Client with this SSN - "+trim(ssn)+ chr(13)+"Does NOT Exist in the MEDICAID Database",16)	
          				MED_FILE.close()
          			end if
          		end if
          		UI_MSG_BOX(agency+" - FIND","Customer SSN Does NOT exist in System. Checking Household!",16)
          		CLSSN = lookupc("F",SOC1,"CLSSN","househol.dbf","ssn")
          		IF CLSSN > "             " THEN
          			clname = alltrim(lookupc("F",clssn,"FNAME","Client.dbf","ssn"))+" "+trim(lookupc("F",clssn,"lNAME","Client.dbf","ssn"))
          			UI_MSG_BOX(agency+" - FIND","This person Also exists in the HOUSEHOLD of a Customer by the name of -  "+chr(13)+chr(13)+ut(clname)+chr(13)+chr(13)+"Displaying "+clname+"'s Customer's Information?")
          			soc1 = clssn
          			tbl.fetch_find(soc1)
          			parentform.resynch()
          		  else
          			UI_MSG_BOX(agency+" - FIND","Customer SSN Does NOT exist in System. Please Search by some other Key!",16)
          			GOTO retry1
          		end if
          	end if
          	end
          end if
          if left(search_by,4)="Full" then
          FULLNAME:
          debugcheck()
          	DIM NAMES(100) as C
          	names.clear()
          	i = 1
          	dim tblc as P
          	tblc = table.open("client")
          	fname1=TRIM(LNAME)+" "+TRIM(FNAME)
          	fname2	= ut(FNAME)+" "+UT(LNAME)
          	indx_2 = tblc.index_primary_put("Fullname")
          	rec = tblc.fetch_find(FNAME1)
          '	if rec > 0
          'new code added here for selection
          	if rec < 0  then
          		'play_sound("g:\BCBSS\UH_OH.wav")
          		UI_MSG_BOX(agency+" - FIND","Customer Entered -  "+chr_multi(13,2)+ut(fname)+" "+ut(lname)+",  DOB - "+DTOC(DOB)+chr_multi(13,2)+"Does NOT exist in our System,"+chr_multi(13,2)+"Please check the spelling and Date of Birth,"+chr_multi(13,2)+"IF it correct,"+chr_multi(13,2)+space(10)+"They may be a NEW Customer.",16)
          		goto retry1
          	  else
          		tblkey = trim(tblc.lname)+" "+trim(tblc.fname)
          		wordct= W_COUNT(tblkey)		
          		while tblkey = fname1
          			names(i)=ut(tblc.fname)+" "+ut(tblc.lname)+" -  SSN: "+left(tblc.ssn,3)+"-"+substr(tblc.ssn,4,2)+"-"+trim(substr(tblc.ssn,6,7))+" - Addr: "+trim(tblc.addr1)+" - Born on: "+dtoc(tblc.dob)
          			tblc.fetch_next()
          			i = i+1
          			tblkey = trim(tblc.lname)+" "+trim(tblc.fname)
          		end while
          		'added by hubert
          		'************************************* 
          		tblc.close()
          		'**************************************	
          		if i = 2
          			SSNN = alltrim(remspecial(word(names(1),wordct+3)))
          			'goto checksoc
          			soc1=padr(trim(ssnn),13," ")	
          			INDX_1 = tbl.index_primary_put("ssn")
          			rec= tbl.fetch_find(soc1)
          			if rec > 0
          				tbl.index_primary_put("Fullname")
          				parentform.resynch()
          				end
          			end if
          		end if
          		names.resize(i-1)
          		names.sort("A","dtos(ctod(word(value,-1)))")
          				
          		dim name1 as C
          		name1 = ""
          		name1 = "We found "+ alltrim(str(i-1,4,0))+" "+replace_parameters(" matches for the name [varC->FNAME2]!  THIS LIST IS IN BIRTH DATE ORDER.",local_variables())
          		name3 = "Please check this list carefully before entering a New Cusomer!"
          		tryagain1:
          		DIM SHARED WHO as C
          		DIM SHARED varC_result as C
          		ok_button_label = "&YES"
          		cancel_button_label = "&NO"
          		varC_result = ui_dlg_box(Agency + " Customer Information",<<%dlg%
          		{region}
          		{text=130:name1};
          		{text=130:name3};
          		{line=1,0};
          		{endregion};
          		{region}
          		Please Select: |[.100,8WHO^#names];
          		{endregion};
          		{line=1,0};
          		{region}
          		<*15=ok_button_label!OK> <15=cancel_button_label!NO>
          		{endregion};
          		%dlg%)
          		if varC_result="NO"
          			ui_msg_box(agency+" Customer Search","Action Cancelled at user request")
          			end
          		end if
          		if who = ""
          			'no client selected, retry
          			ui_msg_box(agency+" Customer Select","No Selection was made, Please Select a Name")
          			goto tryagain1
          		end if
          		ssnn = padr(alltrim(remspecial(word(who,wordct+3))),13," ")
          		soc1=padr(trim(ssnn),13," ")	
          		INDX_1 = tbl.index_primary_put("ssn")
          		rec= tbl.fetch_find(soc1)
          		if rec > 0
          			tbl.index_primary_put("Fullname")
          			parentform.resynch()
          			end
          		end if
          	end if
          	end
          end if
          if search_by="Last Name" then
          	lname2=padr(trim(lname)+" A",25," ")
          	indx_3 = tbl.index_primary_put("Fullname")
          	'fetch_first(db_current())
          	rec = tbl.fetch_find(lname2)
          	if tbl.lname <> lname  then
          		'play_sound("g:\BCBSS\UH_OH.wav")
          		UI_MSG_BOX(agency+" - FIND","Customer Name -  "+chr(13)+chr(13)+ut(lname)+chr(13)+chr(13)+"Does NOT exist in our System,"+chr(13)+chr(13)+"Please check the spelling,"+chr(13)+space(10)+"OR"+chr(13)+"They may be a NEW Customer.",16)
          		goto retry1
          	  else
          		parentform.resynch()						
          		UI_MSG_BOX(agency+" - FIND","This is the FIRST customer with a Last name of"+chr(13)+chr(13)+ut(lname)+chr(13)+chr(13)+"If this is not who you need, hit "+chr(39)+"Page Down"+chr(39)+" until you retrieve your Customer",64)
          	end if
          	end
          end if
          if search_by="Last Name 1st Initial" then
          reenter:
          	lfname1=ut(lname)+", "+ut(int)
          	dim names[400] as C
          	names.clear()
          	i = 1
          	dim tblc as P
          	tblc = table.open("client")
          	indx_2 = tblc.index_primary_put("LastFirst")
          	'fetch_first(db_current())
          	rec = tblc.fetch_find(LFNAME1)
          	'new code added here for selection
          	if rec < 0  then
          		'play_sound("g:\BCBSS\UH_OH.wav")
          		UI_MSG_BOX(agency+" - FIND","Customer Entered -  "+chr_multi(13,2)+ut(int)+" "+ut(lname)+",  DOB - "+DTOC(DOB)+chr_multi(13,2)+"Does NOT exist in our System,"+chr_multi(13,2)+"Please check the spelling and Date of Birth,"+chr_multi(13,2)+"IF it is correct,"+chr_multi(13,2)+space(10)+"They may be a NEW Customer.",16)
          		goto retry1
          	  else
          		tblkey = trim(tblc.lname)+", "+ut(left(tblc.fname,1))
          		while tblkey = lfname1
          			if dob <>{} 
          				if tblc.Dob = dob
          			  		names(i)=ut(tblc.fname)+" "+ut(tblc.lname)+" -  SSN: "+left(tblc.ssn,3)+"-"+substr(tblc.ssn,4,2)+"-"+trim(substr(tblc.ssn,6,7))+" - Addr: "+trim(tblc.addr1)+" - Born on: "+dtoc(tblc.dob)
          					i = i+1
          				end if
          			  else
          			  		names(i)=ut(tblc.fname)+" "+ut(tblc.lname)+" -  SSN: "+left(tblc.ssn,3)+"-"+substr(tblc.ssn,4,2)+"-"+trim(substr(tblc.ssn,6,7))+" - Addr: "+trim(tblc.addr1)+" - Born on: "+dtoc(tblc.dob)
          					i = i+1
          			end if
          				tblkey = trim(tblc.lname)+", "+ut(left(tblc.fname,1))
          				tblc.fetch_next()	
          		end while
          		'added by hubert
          		'************************************* 
          		tblc.close()
          		'**************************************	
          		if i = 2
          			if word(names(1),5)="SSN"
          				SSNN = alltrim(remspecial(word(names(1),6)))
          			  else
          			  	SSNN = alltrim(remspecial(word(names(1),5)))
          			end if
          
          			'goto checksoc
          			soc1=padr(trim(ssnn),13," ")	
          			INDX_1 = tbl.index_primary_put("ssn")
          			rec= tbl.fetch_find(soc1)
          			if rec > 0
          				tbl.index_primary_put("Fullname")
          				parentform.resynch()
          				end
          			end if
          		end if
          		names.resize(i-2)
          		names.sort("A","word(value,1)+dtos(ctod(word(value,-1)))")
          				
          		dim name1 as C
          		name1 = ""
          		name1 = "We found "+ alltrim(str(i-1,4,0))+" "+replace_parameters(" matches for the name [varC->LFNAME1]!  THIS LIST FIRST NAME ORDER.",local_variables())
          		name3 = "Please check this list carefully before entering a New Cusomer!"
          		tryagain5:
          		DIM SHARED WHO as C
          		DIM SHARED varC_result as C
          		ok_button_label = "&YES"
          		cancel_button_label = "&NO"
          		varC_result = ui_dlg_box(Agency + " Customer Information",<<%dlg%
          		{region}
          		{text=130:name1};
          		{text=130:name3};
          		{line=1,0};
          		{endregion};
          		{region}
          		Please Select: |[.110,15WHO^#names];
          		{endregion};
          		{line=1,0};
          		{region}
          		<*15=ok_button_label!OK> <15=cancel_button_label!NO>
          		{endregion};
          		%dlg%)
          		if varC_result="NO"
          			ui_msg_box(agency+" Customer Search","Action Cancelled at user request")
          			end
          		end if
          		if who = ""
          			'no client selected, retry
          			ui_msg_box(agency+" Customer Select","No Selection was made, Please Select a Name")
          			goto tryagain5
          		end if
          		if word(who,5)="SSN"
          			SSNN = padr(alltrim(remspecial(word(who,6))),13," ")
          		  else
          		  	SSNN = padr(alltrim(remspecial(word(who,5))),13," ")
          		end if
          		'ssnn = padr(alltrim(remspecial(word(who,5))),13," ")
          		soc1=padr(trim(ssnn),13," ")	
          		INDX_1 = tbl.index_primary_put("ssn")
          		rec= tbl.fetch_find(soc1)
          		if rec > 0
          			tbl.index_primary_put("Fullname")
          			parentform.resynch()
          			end
          		end if
          	end if
          	end
          end if
          '******************  NEW 01/16/2008  ****************************
          if search_by="Last, First, DOB" then
          	FNAME = FNAME1
          	'debug(1)
          	DIM NAMES(20) as C
          	names.clear()
          	i = 1
          	dim tblc as P
          	tblc = table.open("client")
          	lname2=padr(trim(lname),25," ")+padr(trim(fname),20," ")+dtos(dob)
          	indx_3 = tblc.index_primary_put("LFDOB")
          	'fetch_first(db_current())
          	rec = tblc.fetch_find(lname2)
          	if rec < 0  then
          		UI_MSG_BOX(agency+" - FIND","Customer Entered -  "+chr_multi(13,2)+ut(fname)+" "+ut(lname)+",  DOB - "+DTOC(DOB)+chr_multi(13,2)+"Does NOT exist in our System,"+chr_multi(13,2)+"Please check the spelling and Date of Birth,"+chr_multi(13,2)+"IF it correct,"+chr_multi(13,2)+space(10)+"They may be a NEW Customer.",16)
          		goto retry1
          	  else
          		tblkey = tblc.lname+tblc.fname+dtos(tblc.dob)		
          		while tblkey = lname2
          			names(i)=ut(tblc.fname)+" "+ut(tblc.lname)+" -  SSN: "+left(tblc.ssn,3)+"-"+substr(tblc.ssn,4,2)+"-"+trim(substr(tblc.ssn,6,7))+" - Addr: "+trim(tblc.addr1)+" - Born on: "+dtoc(tblc.dob)
          			tblc.fetch_next()
          			i = i+1
          			tblkey = tblc.lname+tblc.fname+dtos(tblc.dob)				   
          		end while
          		'added by hubert
          		'************************************* 
          		tblc.close()
          		'**************************************	
          		if i = 2
          			if word(names(1),5)="SSN"
          				SSNN = alltrim(remspecial(word(names(1),6)))
          			  else
          			  	SSNN = alltrim(remspecial(word(names(1),5)))
          			end if
          			'SSNN = alltrim(remspecial(word(names(1),5)))
          			goto checksoc
          		end if
          		names.resize(i-1)		
          		dim name1 as C
          		name1 = ""
          		dim namex as C
          		namex = word(names[1],1)+" "+word(names[1],2)
          		name1 = replace_parameters("Is One of these the Correct Customer record for [varC->namex]?",local_variables())
          		tryagain2:
          		DIM SHARED WHO as C
          		DIM SHARED varC_result as C
          		ok_button_label = "&YES"
          		cancel_button_label = "&NO"
          		varC_result = ui_dlg_box(Agency + " Customer Information",<<%dlg%
          		{region}
          		{text=70:name1};
          		{line=1,0};
          		{endregion};
          		{region}
          		Please Select: |[.100,5WHO^#names];
          		{endregion};
          		{line=1,0};
          		{region}
          		<*15=ok_button_label!OK> <15=cancel_button_label!NO>
          		{endregion};
          		%dlg%)
          		if varC_result="NO"
          			ui_msg_box(agency+" Customer Search","Action Cancelled at user request")
          			end
          		end if
          		if who = ""
          			'no client selected, retry
          			ui_msg_box(agency+" Customer Select","No Selection was made, Please Select a Name")
          			goto tryagain2
          		end if
          		if word(who,5)="SSN"
          				SSNN = padr(alltrim(remspecial(word(who,6))),13," ")
          			  else
          			  	SSNN = padr(alltrim(remspecial(word(who,5))),13," ")
          		end if
          		'ssnn = padr(alltrim(remspecial(word(who,5))),13," ")
          		goto checksoc
          	end if
          end if
          '******************************************************************************						
          if search_by="Investigations" then
          	addr=STATE+LEFT(CITY,5)+LEFT(WORD(ADDR,2),7)+WORD(ADDR,1)
          	debugcheck()
          	tbl.index_primary_put("ADDRESS")
          	'fetch_first(db_current())
          	rec = tbl.fetch_find(addr)
          	if rec >0  then
          		parentform.resynch()
          		ui_msg_box(agency+" - FIND","A Customer with this Address Exists! Please check that this is the Customer you requested.",16)
          	  ELSE
          		UI_MSG_BOX(agency+" - FIND","Customer Address Does NOT exist in System, may be a NEW Customer.",16)
                 	goto retry1
          	end if
          	
          end if
          end
          I've also attached it as a .txt file so you can print it and take your time looking it over.:)

          Good luck,

          Tom

          Comment


            #6
            Re: Creating a find button

            Tom,

            What the heck is "debugcheck()"?

            Comment


              #7
              Re: Creating a find button

              Sorry about that. :o

              Debugcheck() is one of our own functions that tests who the user is, and if the user is one of the MIS people, it asks if we want to turn on the debugger. It is very useful when we are trying to work out the kinks in a live system.


              Code:
              'Date Created: 14-Jan-2005 10:35:15 AM
              'Last Updated: 09-Jun-2006 02:09:41 PM
              'Created By  : Tom Henkel
              'Updated By  : Tom Henkel
              FUNCTION debugcheck AS V ( )
              if LEVEL = "A"
              	ans2 = ui_msg_box("Test","Do you want to turn on the debugger?",36)
              	IF ans2 = 6
              		debug(1)
              	ELSE
              		debug(0)
              	END IF
              end if
              END FUNCTION

              We set many variables at system open, "LEVEL" is only one of them. We use the addin variable space extensively as well.

              Tom

              Comment


                #8
                Re: Creating a find button

                Look at the samples for "Learning XDialog", then go to "Listviews", "Progressive Lookups".
                You can do what you want with minimal hand coding.
                Garry

                Comment


                  #9
                  Re: Creating a find button

                  Garry,

                  I know this is an older thread although I am looking for the section on "Progressive Lookups". I am using v10.5 and cannot find anything called under Learning Xdialog. Any suggestions?

                  Scott

                  Comment


                    #10
                    Re: Creating a find button

                    Scott,

                    When you first open v10 "Learning XDialog" is listed in the "Sample and Tutorial Databases".

                    Also note that in v10 there is a "Supercontrol" available in form design that is similar in result but way easier to design. See Alphasports "Customer Information" form for an example.

                    Comment


                      #11
                      Re: Creating a find button

                      Hey Scott, this is another Garry, What I did was use the progressive find code in Alpha Sports. I just copied it from the code tab section of alpha sports and pasted it into the code tab section of my database and changed a few things to match my tables, then put a button on my form to call the progressive find code. Works great! Just start typing in a name and the number of results get smaller until you have just the one name if you want. Usually the name comes up in the list and I just select it.

                      Comment


                        #12
                        Re: Creating a find button

                        Hey Garry Flanigan, you don't see too many two R Garrys

                        Comment


                          #13
                          Re: Creating a find button

                          As my first name and last name are not spelt the more common ways, it means that almost no-one spells my name correctly.
                          I argue that Garry is the "correct" spelling as it is pronounced like Harry or Barry as oppposed to Gary that should be pronounced like scarey.

                          Comment


                            #14
                            Re: Creating a find button

                            That's my response to people too when they say "Two R's!!" I also tell them that I have a brother Larry and a brother Terry so I had to have two R's.

                            Comment


                              #15
                              Re: Creating a find button

                              Originally posted by Scott Kurimski View Post
                              Garry,

                              I know this is an older thread although I am looking for the section on "Progressive Lookups". I am using v10.5 and cannot find anything called under Learning Xdialog. Any suggestions?

                              Scott

                              Scott,
                              I have posed many examples of progresive lookups that work well. Here is my latest. See if this might be something that might suit your needs. The list view progressive lookup is a monstrocity of a code that I, for one, haven't the capabilities of working with. There are other options that are far more workable that I have captured that are more "understandable" and convertable. The one in this example allows searches that can capture internal values such as first name and combinations contained in the search value.


                              http://msgboard.alphasoftware.com/al...ad.php?t=89999
                              Last edited by Mike Wilson; 10-23-2010, 01:00 AM.
                              Mike W
                              __________________________
                              "I rebel in at least small things to express to the world that I have not completely surrendered"

                              Comment

                              Working...
                              X