473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Change focus on form

Hello again,

Im hoping somebody can help me with this problem :)

In my database i have a from called "Farms", on the from i have 1 fields called "Farm_Name" and a subform called "Houses". When the focus leaves the last field in the Houses subform i want the cursor to return to the main form and for the last record entered in the subform to still show.....to do this i used the following code on the "OnLostFocus" event of the last field in the subform.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  Forms![Farms]![Farm_Name].SetFocus
  3.       Forms![Farms]![Houses].Requery
  4.  
Till now everything is still working great....The problem is that when i try to return to the subform "Houses" the cursor wont leave the main forms "Farm_Name" field.

I dont know whats going on. Any help would be greatly appreciated.
Thanks alot,
Christina
Mar 27 '07 #1
2 1955
missinglinq
3,532 Expert 2GB
I'm not sure of the why but it sounds like you're looping right back to the piece of code thhat you posted so that you're forever setting focus back on the control in the main form.
Mar 27 '07 #2
I'm not sure of the why but it sounds like you're looping right back to the piece of code thhat you posted so that you're forever setting focus back on the control in the main form.

thanks for the reply,

if i remove the requery methode it works, but the problem is that the fields in the subform are then cleared, and i need them to show.
So im thinking the problem is in the Requery.
Mar 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: fish | last post by:
Hi, I have an HTML page with a FORM and some input fields. On the fields I wish to do validation as the punters change the field values. If they get it wrong, then I tell them and then wish...
6
by: Brian | last post by:
I'm trying unsuccessfully to use a variable in a script that changes focus. Depending on which link a user follows (navigates via keyboard or clicks), I'd like to change the focus to an input...
1
by: Knud | last post by:
I have a frameset where a hidden frame reloads every 5 seconds and collects data from the sever if there are any changes made in a database. The hidden page updates Div fields on other frames with...
3
by: bunch92 | last post by:
Hi guys The code below will be used to fill in a crossword grid. When a user types a letter, focus is changed to next cell in the grid. My code doesn't work and I would be grateful if you...
0
by: Wayne Wengert | last post by:
I have a form on which I change background colors when textbox get focus and I reset the background color when it loses focus. This works fine except when I change the focus via code. If I validate...
5
by: cj | last post by:
..net 2003 I have a form with 1 button and several labels on it. I don't want the button to be the default if enter is pressed. I want the user to have to actually click it for it to work. I...
4
by: Jon Slaughter | last post by:
I've created some custom controls and forms that allow the feature to temporarily transfer focus to a control that has been entered by the mouse. Everything seems to work fine but the problem I...
1
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while...
2
by: sreemati | last post by:
Hi One of the web form has 3 dates fields: Date of form entry, date of diagnosis and date of death. Date of form entry has future date validation done which I thought of extending to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.