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

Show newly added record

Hi,

I am working in MS Access 2000 and have created two forms. Form 1 is
called frmParent (which has a subform called SfrmChild). FrmParent has
a list box that lists all the Last Names of parents in the db. Clicking
on one of the lastname of parent in the list box shows children of
selected parent in the SfrmChild. I have a button on frmParent that
opens up a pop up form where user can add children to the selected
parent. My problem is when I close the pop up form, It does not take me
to the selected parent for whom I added the children. For example if I
added children for Mr.Smith, the children gets added to subform but
closing the pop up form does not take me to Mr. Smith's record. How can
I automate that each time I add children for a selected parent, closing
the pop form will take me to the selected parent's record for whom I
added the children.

I will appreciate any help.

Thanks

Jun 16 '06 #1
2 2158

Kaur wrote:
Hi,

I am working in MS Access 2000 and have created two forms. Form 1 is
called frmParent (which has a subform called SfrmChild). FrmParent has
a list box that lists all the Last Names of parents in the db. Clicking
on one of the lastname of parent in the list box shows children of
selected parent in the SfrmChild. I have a button on frmParent that
opens up a pop up form where user can add children to the selected
parent. My problem is when I close the pop up form, It does not take me
to the selected parent for whom I added the children. For example if I
added children for Mr.Smith, the children gets added to subform but
closing the pop up form does not take me to Mr. Smith's record. How can
I automate that each time I add children for a selected parent, closing
the pop form will take me to the selected parent's record for whom I
added the children.

I will appreciate any help.

Thanks


Kaur, when you move back to the frmParent, hit the F9 key - this
carries out a page refresh.
If you want to do this automatically, you can set up an auto refresh
(known as a requery) in the AfterUpdate method of the frmParent and the
OnClose method of the SfrmChild. The command would look something like
this:

sub SfrmChild Close()
docmd.openform "frmParent"
docmd.close acDefault
end sub

sub frmParent AfterUpdate()
docmd.requery
end Sub

Hope this helps.
D

Jun 16 '06 #2
Thanks for the reply,
My problem is the subform does get updated but it does not show me the
record for which I added the children. e.g. If I added the children for
Mr. Smith, on closing the pop up form it shows me the record that comes
first in ascending order of the parent listbox.
I want the popup form close action to take me back to Mr. Smith's
record.

Manjeet

ComputerJunkie wrote:
Kaur wrote:
Hi,

I am working in MS Access 2000 and have created two forms. Form 1 is
called frmParent (which has a subform called SfrmChild). FrmParent has
a list box that lists all the Last Names of parents in the db. Clicking
on one of the lastname of parent in the list box shows children of
selected parent in the SfrmChild. I have a button on frmParent that
opens up a pop up form where user can add children to the selected
parent. My problem is when I close the pop up form, It does not take me
to the selected parent for whom I added the children. For example if I
added children for Mr.Smith, the children gets added to subform but
closing the pop up form does not take me to Mr. Smith's record. How can
I automate that each time I add children for a selected parent, closing
the pop form will take me to the selected parent's record for whom I
added the children.

I will appreciate any help.

Thanks


Kaur, when you move back to the frmParent, hit the F9 key - this
carries out a page refresh.
If you want to do this automatically, you can set up an auto refresh
(known as a requery) in the AfterUpdate method of the frmParent and the
OnClose method of the SfrmChild. The command would look something like
this:

sub SfrmChild Close()
docmd.openform "frmParent"
docmd.close acDefault
end sub

sub frmParent AfterUpdate()
docmd.requery
end Sub

Hope this helps.
D


Jun 19 '06 #3

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

Similar topics

6
by: Tony Stoker | last post by:
I have a .Net web app that adds a record to a SQL database. After the user adds their record I want to have a link that will link them to their new record! The recordID is a AutoNumber in the...
3
by: damezumari | last post by:
I am using WinXP and MS Access 2003. I have a list whose row source is an sql. I insert a new record to the table the sql takes its data from. I requery the list and the new record appears. ...
3
by: Kaur | last post by:
Hi, I would appriceate any help to correct the code error that I am getting for the onclick event of a cmd button. I have two forms. Main Form "frmQuestion" and form 2 "SfrmQuestion"....
3
by: rdufour | last post by:
Using Vs2005. In this snippet of code I would be creating a new record in a sql server 2000 database table. How do I obtain the value of primary key - field name PK - for the newly created record....
0
by: Sooraj | last post by:
Hi all I am using vb.net 2002. To add records to grid, I click on button and display modal form with various text boxes. f.showdialog() When I save the record (by selecting MAXID from table)...
6
by: gerbski | last post by:
Hi all, I am relatively new to ADO, but up to now I got things working the way I wanted. But now I've run into somethng really annoying. I am working in MS Access. I am using an Access...
9
by: =?Utf-8?B?UHJhdmlu?= | last post by:
We are using .net Framework 1.1 We are having one page on which we are using this Grid component. From this page we open a popup for adding new record as well as for editing an existing record...
2
nev
by: nev | last post by:
i place values in a new row programatically. it has an auto-increment column. after adding the entries i do... bindingsource.endedit() tableadapter.update(dataset.datatable) the saving process...
0
by: fig000 | last post by:
Hi, I'm using an objectdatasource. The insert procedure called by the objectdatasource is in a separate library file outside of the aspx and the codebehind that is using the objectdatasource in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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: 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...
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...

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.