473,387 Members | 1,497 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.

Refreshing the main form

18
Hi Everybody,
I am working on a database that creates the Student Code and their email id's.
Table Student stores basic information like First name, last name, address, class etc. Table Email stores Student code, Email Id, creation date. I created a main form from table Student and a command button on it, which opens the Email Form, it takes the value of Student code from the main form and the email id is entered in that form. Tables have one-to-one relationship. In my main form I have created a subform that shows the created Email Id, My problem is that when I create the email id and close the Email form, that created email id is not visible in the main form's subform. It is visible only when I close the form and reopens the particulat code. I have tried the requery method but does'nt worked. Any idea om solving will be highly appreciated.
Thanks a lot in advance.
Jun 29 '07 #1
6 1854
missinglinq
3,532 Expert 2GB
Where have you tried the Requery and what exact code have you used?
Jun 29 '07 #2
130975
18
Hi missinglinq
I have been trying to refresh the main Student Form.
I tried the code

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_GotFocus()
  2.   DoCmd.RunCommand acCmdRefresh
  3. End Sub
It is not working.
I am confused where to use it.
Thanks.
Jul 2 '07 #3
missinglinq
3,532 Expert 2GB
To be honest, I'm a little fuzzy as to the ins and outs of exactly what you're trying to do! But, to begin with, Refresh does nothing until the RecordSource has been Requeried! In the code behind the command button that opens up the Email form, place this code on the next line after you open the Email form:

Me.Requery
Jul 3 '07 #4
NeoPa
32,556 Expert Mod 16PB
Linq is very much on the right lines. Try :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_GotFocus()
  2.   Call Me.ReQuery()
  3. End Sub
This is likely to prove expensive on processing unless you only put focus back to the form after your other form closes.
It should still work whatever though.
Jul 3 '07 #5
130975
18
Hi,
Thanks everybody for devoting your valuable time in solving my problem.
I used the following code on close of Email form.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.Close
  2. Student.Form_Student.Requery
Once again thank you all.
Jul 4 '07 #6
NeoPa
32,556 Expert Mod 16PB
No problem. Glad to see you got a solution :)
Jul 4 '07 #7

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

Similar topics

1
by: sentinel | last post by:
Hello, I'm having problems refreshing a main window, and am not sure really whether the solution will be Javascript or PHP related. Firstly, I have a main file that calls a pop-up box which...
0
by: Mark Payne | last post by:
Gudday, I have an Access 2000 database which I am using as a phone directory of residents in the hostel where I work. The front end for this directory is a form with a text box (the search name...
9
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text field called . It gets populated based on what the user selects in a field on the...
1
by: MaXXXiMaNiAc | last post by:
Hey all, I have attached here a sample of what im trying to do. Basically i set up a combo box in a subform where an employee will select his name. I want the selection to be made only once...
3
by: G25532 | last post by:
I have a form that contains a macro button which on clicking, opens a subform over the main form. I have in the macro "Where Condition" the following: =!! The subform has related fields as...
3
by: gsb58 | last post by:
Hi! A mainform is being used to show records from a table in an sql database. A button on the main form will load a new form that allows the user to add, delete, update and search certain...
2
by: dmartin_1 | last post by:
I'm building an application with Visual Basic 2005. The application is multi threaded. It has a record counter on the form that counts up to completion. It works fine throughout the process as...
1
by: Iain | last post by:
I am attempting to create an "easy input (from the pov of the user)" form. A main form displays one page per record with a sub form displaying a list of records related to the main record. The...
0
by: sean.hpr | last post by:
Hi all- I am a vb2005 newb so apologies in advance. Essentially I am having some problems with data refreshing on some of my forms. Background: I have created a project containing a few...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.