You don't need to lock your form to prevent adding new records. Just set the
AllowAdditions property for the form to No and you won't get that new record
line at the bottom of your form. When you want to add a new record, use the
following code in some event:
Me.AllowAdditions = True
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(E-Mail Removed)
"Tobias" <(E-Mail Removed)> wrote in message
news

DDCD6A3-716F-43A4-90BF-(E-Mail Removed)...
> Can anyone please help me with the following:
>
> I have a Form with multiplies of subforms witch are related by relations.
> It is possible for the user to enter the form and change a specific record
> by selecting the specific form from a kombolist witch refers to the list
> of
> ID's from my main table.
> The Form is for good reasons locked so that the user not by mistake, can
> add
> new records when he is changing in an existent record, just by scrolling
> down.
>
> I now want to be able to add new records to the database by typing in a
> new
> ID, but here comes the problem.
> I tried by SQL to "insert into" my main table and by that it should update
> my other related tables, but it doesn't.
> I also tried manually to enter a record in my main table, but it doesn't
> add
> the same entered ID to my other tables. This results in my subforms to be
> "invisible" or blank when I enter my mainform with the new entered ID.
> Is there a SQL-code that inserts a value from a txt-box in many tables at
> one time, so that access don't give me an error due to my relations of
> tables
> or can I delete my relations and hardcode an insert-statement to all of my
> tables at ones?
>
> Best regards Tobias
>