Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching 1

Status
Not open for further replies.

rclarke

Technical User
May 14, 2001
78
GB
I have a form which my users use to amend records

to search for the correct record they select for example the organisation click on search and the details come up on the same form for that organisation for them to amend.

However on some of the forms the fields on the form stay filled in with the last amended record instead of being blank when you enter the form from the menu.

How do I make it so that they are blank? until they click on the search button?????

All you help is appreciated very much

Rachel
 
Hi,
It depends on how the forms objects are bound. If the text boxes are bond to fields, then the current record pointer supplies the information. In this case, if you are using views, then NO DATA ON LOAD will keep the view blank.

If however the scatter / gather is done and the memory variables are bond to text boxes, then all you have to do is ... SCATTER MEMVAR BLANK when you enter the form. This will initialise the variables to blank values.

Hope this helps. :) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
As an alternate to Ramani's suggestion, you could append a blank record and set the record pointer to that record then if the form objects are bound to the record they will be blank. You would probably want to determine if a blank record already exists prior to appending a new one. If a blank record exists then move the record pointer to it else append blank.

Personally, I use one of Ramani's methods (my preference is to scatter and gather but that is old school and there are probably a number of people on the forum who will give valid reasons for their preferences.)
 
gcole

Yes I have tried refresh this does not appear to do the trick

Ramani

I think the No DATA ON LOAD is what I need scatter memvar blank does not work .

Could you elaberate on the NO DATA ON LOAD please.

I.E where do I stick it.

Thank you all for you time

Rachel
 
Rachel

You could try forcing the values of the textboxes as follows:-

WITH THISFORM
[tab]FOR i = 1 TO .ControlCount
[tab][tab]IF UPPE(SUBS(.Controls(i).Name,1,3)) = [TXT]
[tab][tab][tab].Controls(i).Value = []
[tab][tab]ENDI
[tab]ENDF
ENDW

or

WITH THISFORM
[tab]FOR i = 1 TO .ControlCount
[tab][tab]IF .Controls(i).Class = [Textbox]
[tab][tab][tab].Controls(i).Value = []
[tab][tab]ENDI
[tab]ENDF
ENDW

You may need to exclude certain textboxes which can code into the FOR...ENDFOR loop

Carling Black Label X-)
 
Thank you Carling Black Label

That works great

Luv

Vodka and Tonic
 
Don't be too quick with the "That works great" comment.
Be careful with things like that. If the TEXTBOX control is still bound to a record with values in it, you will be deleting the value of those fields in the file as you assign the value to ''.

I am really not sure what all this rigamaro is for. This type of operation should not be this complicated. Set the control.source to the fields they represent, append blank, refresh, and you are done. I am not even sure if you need the refresh.



Don
dond@csrinc.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top