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

Access Sub Forms

Hello All

I am trying to build a couple of forms in Access 2000. Whilst I have
one form which has all of the contact details in it also generates
(using autonumber) a unique id for the customer.

I have also created a button to open up another form which looks at a
second table. I want the ID automatically populated into the form
(tables are designed one to many) so that correspondence can be added.
At the moment access states that data needs to be inserted into the
clients table before data can be inserted into the correspondeance
table.

A subform has been successfully created using the button on the tools
menu but it embeds it within the existing form. However, it does throw
in the CustID automatically!

I've tried creating a separate form and linking the custID which is
primary to the foreign key custID in the corres table but it still
gives me the jip! Any ideas would be truly appreciated since I am new
to access and need to get something up and running sharpish!

Thanks in advance

Simon
Nov 12 '05 #1
1 3720
Answers interspersed:

"Simon" wrote
I have also created a button to open
up another form which looks at a
second table. I want the ID auto-
matically populated into the form
(tables are designed one to many) so
that correspondence can be added.
At the moment access states that data
needs to be inserted into the clients
table before data can be inserted into
the correspondeance table.
And that is a _good_ thing, because it will keep you from, eventually,
having to worry about all the "orphan records" in the related tables. All
you have to do is to _explicitly_ save the record before opening the second
form and passing the ID, as:

DoCmd.RunCommand acCmdSaveRecord
A subform has been successfully created
using the button on the tools menu but it
embeds it within the existing form.
Actually, Access has nothing known just as "subform". It does have a Subform
Control (which, by definition, has to be embedded in a Form). You then embed
a Form in the Subform Control.
However, it does throw
in the CustID automatically!


And, the Boys and Girls in Redmond thought ahead as to how a Form embedded
in a Subform Control might be used -- realizing it might well be used to
enter new Records in related Tables, they opted to save the record on the
parent Form when you move from the Parent to the Form in the Subform
Control.

So, you can either do the explicit Save, or use the Subform Control --
whichever you prefer.

Larry Linson
Microsoft Access MVP
Nov 12 '05 #2

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

Similar topics

1
by: J | last post by:
Hi, Ive got 3 forms, (a subform within a subform within a form) and when I refresh the outermost form, Access closes and offers to send an error report. The forms worked fine a few weeks ago,...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
22
by: Deano | last post by:
Hi, I have a finished Microsoft Access app that we are distributing using an Access runtime. This works fine (mostly) but I'm sold on the advantages of dot.NET and upgrading to vb.NET seems...
6
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
9
by: Bob Alston | last post by:
I am looking for electronic forms software that would integrate well with MS Access. I have a client for whom I built a client database to replace and update one they had that was obsolete and...
11
by: Chad | last post by:
Hi Is it possible to substitute an alternative data source (eg MySQL or SQL Server) into an existing MS-Access application?
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. 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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.