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

Update sub-form on tab from field

I have a sub-form(company name & address) that is connected to my
contact listing. When I change the contact, it doesn't update the
subform until I close the main form or refresh. Is there a way to make
it update when I tab out of that field?

Thanks.

Nov 13 '05 #1
2 5312

"Rosy" <kr****@portlite.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a sub-form(company name & address) that is connected to my
contact listing. When I change the contact, it doesn't update the
subform until I close the main form or refresh. Is there a way to make
it update when I tab out of that field?


Could you clarify? I'm not sure I understand what you are doing and
expecting.

Does your Subform Control use the LinkMasterFields and LinkChildFields to
synchronize with the Record in the main Form? Do you mean when you move to
another Record in the main Form that the Subform is no longer synchronized?
If you use the LinkMasterFields and LinkChildFields, then it should
synchronize.

If you are displaying the same data in the main Form and the Form embedded
in the Subform control, and change some data in the main Form, that is a
different situation. If so, give additional details and perhaps someone can
assist.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #2
Here is the code that I use. I have a subform that updates off another
subform. This updates the secondary subform and takes me to a new
record in the primary subform. I had to combine several suggestions
from others that posted to figure this out.

1. Copy and paste the info below into the last field you update in the
after update. It will obviously be in between the Private sub and the
End comments.
Me.Requery
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acNext
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acPrevious
RunCommand (acCmdRecordsGoToNew)

2. Copy the text below into the primary or only subform properties (if
you are not using a subform within a subform don't worry about this).
Me.Requery
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acNext
DoCmd.GoToRecord acForm, "Yourmainformname (not subform in between
these quotations", acPrevious

On the first one, it will make the main form go to the next record and
then back. After that it will automatically go to a new record within
the subform.

The 2nd one is because I use a subform within a subform to check for
linked data between records, ie same bank account, address, vehicle,
etc. If you don't do this, then it is of no use. It basically updates
my second subform if I was to delete something from the main subform.

I hope this helps, it drove me nuts for a while.

armydatabase.com

Nov 13 '05 #3

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

Similar topics

16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
0
by: compuglobalhypermeganetz0r | last post by:
I am having trouble getting an adapter to update my access database, it gives the error Syntax error in INSERT INTO statement. for Line 98: Adapter.Update(WineDS, "tblWines") Below is my...
2
by: Ron | last post by:
Hello, I am trying to create a page that pulls class rosters from an SQLServer database. The roster table definition is: emp_id(pk, fk), sec_id(pk, fk), reg_date and reg_status. Status can be...
3
by: Terry Olsen | last post by:
I've got 2 different web pages, both updating the same SQL database. One is for the Technician and one is for the Manager. The technician's update page works fine but the Manager's update page...
4
by: Stephen Plotnick | last post by:
In a data grid using Access as the data source.. The da.update is failing with "object reference not set to an instance of anobject" It looks like everything is ok and I was wondering if there...
1
by: komatouch09 | last post by:
Hi I am new to visual basic. I write program to navigate & update data from table. My database is in Informix & use ODBC connection. When I nevigate the data it works properly. When I Update the...
0
by: fitzini | last post by:
Hi all, I need to update multiple rows using a sub query. I've pasted sample code below to hopefully help recreate what I'm trying to do. drop table dummy_test create table dummy_test (cmr...
2
by: Frogpolish | last post by:
well after searching ans coming up with nothing i figured id post something in here to see if i could get some help. i have an access db that keeps track of flights that ive flown. its a logbook...
5
by: P.J.M. Beker | last post by:
Hi there, I'm currently writing a program in which I use the FileMonitor to monitor a folder in which I store downloaded images. I know that I can't add much coding in the filemonitor's event 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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
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...

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.