A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sub-Form data entry



 
 
Thread Tools Display Modes
  #21  
Old December 2nd, 2009, 01:47 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Sub-Form data entry

If you have created a mainform record, it is saved the moment you focus on
the subform. If you are not focusing on the subform first, you must
explicitly save the mainform's record before moving to the "Data Entry Form"
You can do that in the button which opens the data entry form.

Also, by using a default value in the foreign key field of the "Data Entry
Form", which refers to the primary key in the main form, you can assure that
field will be properly filled. It is imperative, however, that the main form
be open, or you'll be prompted for the value. Set the foreign key field's
textbox's DefaultValue to something like:

=Forms!MainFormName!PrimaryKeyTextboxName
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"John S" wrote in message
...
Arvin,

You may have misunderstood what I am trying to do.

If you enter a new record direct into a sub-form control then the 'one'
side
of the relationship is automatically updated.

When using a seperate Data Entry Form (bound to the sub-form's table) MS
Access doesn't know that the 'one' side needs to be updated. Presumably
because there is no Link Child Fields and Link Master Fields properties on
the Data Entry Form.

In short, I need to tell the Data Entry Form to relate to the current main
form record. Does anyone know how?

Regards,
John.

"Arvin Meyer [MVP]" wrote:


"John S" wrote in message
news
Jeff,

Sorry - yes - the sub-form is the many side of a one-to-many
relationship.
You've hit the nail on the head!

Is there an easy way to update the 'one' side field (ie main
form/table)
from my Data Entry form?


If the data entry form is bound to the subform's table, as is the usual
case, the answer is no. Why would you want to enter data on the many-side
without a one-side record? That's like a doctor creating an operation
when
he hasn't contacted the patient yet.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


.



  #22  
Old December 3rd, 2009, 12:11 PM posted to microsoft.public.access.forms
john s
external usenet poster
 
Posts: 50
Default Sub-Form data entry

Arvin,

Many thanks. I had overlooked the DefaultValue. All now works fine.

Regards,
John.

"Arvin Meyer [MVP]" wrote:

If you have created a mainform record, it is saved the moment you focus on
the subform. If you are not focusing on the subform first, you must
explicitly save the mainform's record before moving to the "Data Entry Form"
You can do that in the button which opens the data entry form.

Also, by using a default value in the foreign key field of the "Data Entry
Form", which refers to the primary key in the main form, you can assure that
field will be properly filled. It is imperative, however, that the main form
be open, or you'll be prompted for the value. Set the foreign key field's
textbox's DefaultValue to something like:

=Forms!MainFormName!PrimaryKeyTextboxName
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"John S" wrote in message
...
Arvin,

You may have misunderstood what I am trying to do.

If you enter a new record direct into a sub-form control then the 'one'
side
of the relationship is automatically updated.

When using a seperate Data Entry Form (bound to the sub-form's table) MS
Access doesn't know that the 'one' side needs to be updated. Presumably
because there is no Link Child Fields and Link Master Fields properties on
the Data Entry Form.

In short, I need to tell the Data Entry Form to relate to the current main
form record. Does anyone know how?

Regards,
John.

"Arvin Meyer [MVP]" wrote:


"John S" wrote in message
news Jeff,

Sorry - yes - the sub-form is the many side of a one-to-many
relationship.
You've hit the nail on the head!

Is there an easy way to update the 'one' side field (ie main
form/table)
from my Data Entry form?

If the data entry form is bound to the subform's table, as is the usual
case, the answer is no. Why would you want to enter data on the many-side
without a one-side record? That's like a doctor creating an operation
when
he hasn't contacted the patient yet.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


.



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.