473,387 Members | 1,834 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,387 software developers and data experts.

When Requering Main Form Disappearing

I have a main form with information on people hired and on this form I
have a button that you click to term an employee which opens a new
dialog window to enter a term date. Now it doesn't remove the
employee from the database but marks their record that they have been
termed by means of a checkbox in their record. The main form loads a
query to organize the table it pulls from. I want the order for the
form to match the query where termed employees are at the end of the
list.

So what I have written for code when you close the dialog window is:

Private Sub btnDone_Click()

Forms!frmEmployeeTable.Form.Requery

DoCmd.Close

End Sub

Now when it requeries to move the newly termed employee to the end (or
that was my hope) the main form disappears and my dialog window stays
open. I'm trying to keep main form window open but reorganize it
without having to exit the form and load it back up again.

Any help greatly appreciated.

~Narvs

Jun 13 '07 #1
2 1827
On Wed, 13 Jun 2007 20:16:43 -0000, Narvs <Pa*********@gmail.comwrote:
>I have a main form with information on people hired and on this form I
have a button that you click to term an employee which opens a new
dialog window to enter a term date. Now it doesn't remove the
employee from the database but marks their record that they have been
termed by means of a checkbox in their record. The main form loads a
query to organize the table it pulls from. I want the order for the
form to match the query where termed employees are at the end of the
list.

So what I have written for code when you close the dialog window is:

Private Sub btnDone_Click()

Forms!frmEmployeeTable.Form.Requery

DoCmd.Close

End Sub

Now when it requeries to move the newly termed employee to the end (or
that was my hope) the main form disappears and my dialog window stays
open. I'm trying to keep main form window open but reorganize it
without having to exit the form and load it back up again.

Any help greatly appreciated.

~Narvs
DoCmd.Close if left unqualified will close the current database object, which in
your case will be frmEmployeeTable due to the previous line.

Change it to -
DoCmd.Close acForm, Me.Name

This will close the form from which the code is run.

Wayne Gillespie
Gosford NSW Australia
Jun 13 '07 #2
Thank you, that fixed my problem with it closing. I completely forgot
that the focus would get switched when I requeried.

~Narvs

Jun 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Howard Jess | last post by:
In Opera 8.01 (Linux; Build 1204) and in Opera 7.54 (Windows XP; Build 3865), my form disappears from the HTML markup (below). To summarize: 1) In a <script> block in the <head> I create a form...
1
by: .Net Sports | last post by:
Periodically, my project dll inside the bin folder keeps disappearing (????) , which creates a "Cannot load type myproject.global " error . ????? ..NetSports
5
by: Lyn | last post by:
Hi, I hope someone can help. I have a main form which mostly fills the Access window. In the bottom half of this form I have a tab control to display various types of data related to the main...
4
by: Kerry Sanders | last post by:
I was playing around with a new Windows form yesterday. I wanted to drop two panels on the form. The first would be set Dock=Top. The second would be set Dock=Fill. So, I dropped the first...
6
by: Winshent | last post by:
I have read many threads which indicate that this was a problem with version 2002. Why should i be suffering this? I am using VB.NET 2003 Standard Edition... is it still a problem with 2003? ...
0
by: No bother | last post by:
The record source for a form I use is based on a query, which has several layers of subqueries with quite a number of joins. Needless to say this record source is not updateble. However, the data...
11
by: Jim | last post by:
Hi, I have created an import module. And would like to access a function from the main script, e.g., file abc.py: ################### def a(): m() return None
2
by: insanity | last post by:
Can anyone help me with a problem that I have with apparently unrelated text disappearing in IE7 when I set a className. This does not happen in Firefox. I am trying to create an Ajax driven...
1
by: JDeats | last post by:
I have many labels that are disappearing from my form when the user resizes it, they seem to dissapear when certain width/height thresholds are exceeded. I have no code in place purposely trying...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.