Set subform to AllowAdditions=true from mainform button

G

Guest

Hi
I have 2 tables, Vehicles (PK "VehID") and Other Info (PK "OtherID"), joined
in a one to many by VehID field.
I have a main form "Vehicles" with a subform "Other Info" displaying related
records. From the main form's "Add New Record" how can I also set the
subform to allow new related records (AllowAdditions = True)?
I've tried Me.[Other Info].AllowAdditions = true which doesn't work... I'm
not sure what the syntax needs to be. Do I need to include "Form" here
somewhere? Please help.

I guess I'll probably have to save the Vehicle record before the Other info
table wil be able to accept a related record.

one to many relationship
 
G

Guest

Thanks PC Datasheet.. got it sorted now

PC Datasheet said:
You were very close!

Try:
Me![Other Info].Form.AllowAdditions = true

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Rich1234 said:
Hi
I have 2 tables, Vehicles (PK "VehID") and Other Info (PK "OtherID"),
joined
in a one to many by VehID field.
I have a main form "Vehicles" with a subform "Other Info" displaying
related
records. From the main form's "Add New Record" how can I also set the
subform to allow new related records (AllowAdditions = True)?
I've tried Me.[Other Info].AllowAdditions = true which doesn't work...
I'm
not sure what the syntax needs to be. Do I need to include "Form" here
somewhere? Please help.

I guess I'll probably have to save the Vehicle record before the Other
info
table wil be able to accept a related record.

one to many relationship
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top