General information
Category:
Forms & Form designer
Hi Mark,
So you set the controlsource of the textbox to the p-view and when you set the parameter to -0 blank controls... Sounds easier to me...
Thanks
>>Up to now I have had two pages on a form one with textboxes with the control source set to the table for editing and one with the control source not set to anything for adding a new record.
>>
>>Am I doing double work?
>>
>>Is there a better way? i.e. less coding, less confusion...
>>
>>Would it be better to not set the control source of the text box to the table and populate the textboxes with the data then update the record when editing and set a semphor flag to indicate if and edit is in process or creating a new record.
>>
>>TIA
>
>I use parameterized views. If the user clicks the ADD button, I update the current record if there were any changes, set the parameter of the view to some unrealistic value [e.g., -1 since all my PKs are positive integers.] and issue a REQUERY() on the view. This obviously returns no records. I then issue an APPEND BLANK and ThisForm.Refresh(). If the user cancels the add, I issue a TableRevert().
>
>You can do basically the same thing with a table buffered VFP table. You just leave out the parameter value and REQUERY() parts.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only