Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Practices in Fetching Recs for a C/S DataEntry Form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MySQL
Miscellaneous
Thread ID:
01473556
Message ID:
01473671
Views:
54
This message has been marked as a message which has helped to the initial question of the thread.
I use remote views and do pretty much what you explained in your first post....but I take it one step farther sometimes depending upon the users needs.

As an example, a user opens a Data Entry form - which is blank - and begin typing in an account number. After they've typed in a few characters, the possible matches start appearing in a grid below this textbox. The more they type, the more it narrows down the search. It's a little tricky to get working - but the users LOVE it. This is what one of the remote views I did a while back to deal with this:

SELECT Demographics.CHARTID, Demographics.HospMedRecNum, Demographics.ACCOUNTNUM, Demographics.HospCode, Demographics.DOS, Demographics.HOSPITAL, Demographics.FINCLASS, Demographics.LOCATION, Demographics.PatientAge, Demographics.PatientDOB, Demographics.PATIENTNAME, Demographics.PatientGender, Demographics.PTypeCode, Demographics.MaritalStatus, Chartlist.CHARTID, Chartlist.BATCHID, Chartlist.RecordTypeCode, Chartlist.AccountNumber, Chartlist.StatusCode, Chartlist.DateNew, Chartlist.DateCoded, Chartlist.DateFlagged04, Chartlist.ChartNote, Chartlist.LastChangedUser, Chartlist.LastChangeDate FROM dbo.DEMOGRAPHICS Demographics INNER JOIN dbo.CHARTLIST Chartlist ON Demographics.CHARTID = Chartlist.CHARTID WHERE LEFT(Demographics.accountnum,?lnChars) = ( ?lcaccountnum ) AND Chartlist.StatusCode = 'New' ORDER BY Demographics.ACCOUNTNUM

The important thing here is this part:
WHERE LEFT(Demographics.accountnum,?lnChars) = ( ?lcaccountnum )

...so you pass two parameters - one for the number of characters they've typed in, and one for the characters themselves. I usually let the users config how many characters they must type in before the searching/narrowing starts to happen - obviously if you have a lot of data you want more than just 1 or 2 chars entered before you try to search so the result sets are not so huge.

Of course then you have to design the front-end to handle all this, which also can turn out to be a real pain. You need a textbox that knows when you're searching vs editing - and when you searching you need to have a grid auto-popup below the textbox - and then you have to deal with all the arrow keys a user can hit on the keyboard and what happens when they hit TAB ..etc etc etc.

It's a little complicated to get it going the first time you try to do this - but like I said - the users really like it.


>Craig,
>
>Thanks for the validation.
>
>What if my Data Entry form shows a 'partial' set of rows like the way Yahoo Mail does it. When the user hits Down (or PageDown) key on the last record, my CA class will then get the next X rows; conversely, if the user hits Up or PageUp. Obviously, the grid will be used for this. When the user resizes the form though, how will we know the number of visible rows?
>
>Any idea how this can be implemented? Or is this a stupid idea?
>
>Dennis
>
>
>
>>You have the correct idea. There are many ways to do this and not enough space here to give all the answers. But, you should start with Remote Views that are parameterized.
>>
>>
>>>Craig,
>>>
>>>Thanks for your reply.
>>>
>>>So, in a CS setting, when a user goes to, say, a Customer Data Entry form:
>>>
>>>1. the Form does not show the Customer records at first, only an 'empty form'
>>>2. functions such as Data Navigation, Edit, Save and Undo are disabled initially - only Search and Create is enabled
>>>3. user then puts in search criteria to be able to get what he wants to view
>>>4. only when records are pulled out will Data Nav, Edit, Save and Undo be enabled
>>>
>>>Is the above 'narration' the way to go? How do you do it sir?
>>>
>>>Dennis
>>>
ICQ 10556 (ya), 254117
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform