[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Auto select alias in visual foxpro

Posted on 2007-11-28
6
Medium Priority
?
230 Views
Last Modified: 2016-05-28
I'm using Visual Foxpro 8.0

1. Manual
Create two freetable as name DBF1 and DBF2
Create form as name FORM1 and adding :
- GRID1 : property RecordSource = 'DBF1'
- GRID2 : property RecordSource = 'DBF2'
- CommandButton1

2. Typing this code in test.prg
* Open two table
Use DBF1 in 0 Alias DBF1
Use DBF2 in 0 Alias DBF2
Select 0 && work-area is empty
* Call Form
Do form FORM1

3. Problem :
- When GRID1 has focus, foxpro auto select to work-area DBF1 ( can see in statusbar)
- When GRID2 has focus, foxpro auto select to work-area DBF2
- When CommandButton1 has focus, foxpro auto select to work-area DBF1 : why.

Why foxpro don't still work-area when focus change from GRID2 to CommandButton1 ( CommandButton1 haven't averything code )

Thank
0
Comment
Question by:levanquan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
mikegagnon earned 1000 total points
ID: 20372777
Can you explain what exactly is the problem?
If Foxpro decides to switch between aliases depending what has focus, is that a problem?
When you want to do something with specific table, just select the alias, for example in your command button click event put SELECT DBF2, it will switch alias for you.
0
 
LVL 8

Expert Comment

by:suhashegde
ID: 20375501
or you can use the 'IN' clause most of the time to work with the table/workarea
0
 
LVL 43

Expert Comment

by:pcelba
ID: 23580291
It is a feature. FoxPro simply remembers the last known non-empty workarea and selects it when you move focus to some data independent control. So in your scenario the workarea could even be DBF2 when you press Command button:

SELECT 0, run the form, set focus to GRID2, then to GRID1, then to Command button - and the work area will change to DBF2...

So you have either select the right work area in your command button (if it is known) or you have to store the current workarea in each grid to some form property and use the stored value in command button.
0
 

Expert Comment

by:EE_AutoDeleter
ID: 41592307
I've requested that this question be deleted for the following reason:

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Not enough information to confirm an answer.

If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Auto Deleter
0
 
LVL 43

Expert Comment

by:pcelba
ID: 41592308
It seems the AI of auto deleter is not too advanced yet :-).

All answers are still valid and explain what should we expect from VFP when switching between grids and other UI controls.

All answers also offer work around. No reason for question deletion. I would say split the points but looking at mikegagnon's total score he should obtain all points to qualify for the new rank in FoxPro zone.

So accept the first answer (ID: 20372777) as the solution please.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question