Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Your answer Edward.
Message
From
19/09/1997 09:54:05
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Your answer Edward.
Miscellaneous
Thread ID:
00050708
Message ID:
00050708
Views:
68
Hi Edward and thanks for you message. Yes I understood. You know
me, if I did not understand, I would of ask you to explain more.
Let me tell you the solution that is working (thanks to you).

I have a COMBO BOX on a FORM
I have a ADD button on the FORM.
I have a textbox called TEXT1 set to VISIBLE = .F.

When the user clicks on the ADD button, the
TETX1 is set to VISIBLE = .T. It then appears over the
COMBO BOX making the COMBO BOX invisible.
The user adds a character string in the TEXT1 area..
In the LostFucus event of the TEXT1 field, I actually add the
record. I have my reasons why I am not using TABLE BUFFERING
on this program.
Here is the code that does the adding in the LostFucus event of the TEXT1 field.

set deleted off
locate for deleted()
if found()
recall
replace myfield with thisform.text1.value && use all deleted records first
else
insert into rob (myfield ) values (thisform.text1.value)
endif
set deleted on
thisform.text1.visible=.f.
thisform.text1.value=""
thisform.combo1.requery()

Here is the code for the CLICK event on the Add button.
thisform.text1.visible=.t.
thisform.text1.setfocus

My problem was, I was trying to add to the COMBO BOX and not to the TABLE. I was not thinking if you add to the TABLE, the COMBO BOX will take care of itself. So, I was looking at the situation in the wrong way. I have learned you do not have to make adjustments to the COMBO BOX , but make adjustments to what the COMBO BOX represents. I realize this is a simple deduction, but you have to remember that for the last 10 years, all I have been doing is writing functions. Now, I must think about objects and the roll they play in the scheme of things along with the functions.
Thanks again…rob
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Reply
Map
View

Click here to load this message in the networking platform