Related Records

  • Thread starter Thread starter margaret hannah
  • Start date Start date
M

margaret hannah

I have a form that when I enter data I must have a related
record in another table. For instance I have TBL tickets
with a record "ID". When I enter in my form FRM Discounts
that saves to TBL Discounts, the record from TBL Tickets
with the "ID" will show on the screen so that I can see
what record FRM Discounts is related to. However, even
though I can see a valid record from TBL Tickets on FRM
Discounts, it will not let me save. It tells me I need a
related record in TBL tickets.

I'm not sure I made sense, but can anyone help me?
 
I have a form that when I enter data I must have a related
record in another table. For instance I have TBL tickets
with a record "ID". When I enter in my form FRM Discounts
that saves to TBL Discounts, the record from TBL Tickets
with the "ID" will show on the screen so that I can see
what record FRM Discounts is related to. However, even
though I can see a valid record from TBL Tickets on FRM
Discounts, it will not let me save. It tells me I need a
related record in TBL tickets.

I'm not sure I made sense, but can anyone help me?

How are your two tables related? Does a record in [TBL Tickets] have
zero, one, or more corresponding records in [TBL Discounts]? (Note
that there ARE no records in FRM Discounts - Forms are display and
editing tools, data is stored only in tables).

What you might want to do is make the Discounts form a Subform of the
Tickets form, using the ID as the master/child link field. This will
ensure that the ID gets copied to any new record entered on the
subform. It is neither necessary nor wise to automatically create an
empty "placeholder" record in the Discounts table though - create a
record, with the ID, when you have data to put into it, not before!

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
My forms are related by "ID". The "ID" in TBL Tickets is
a one to many on the TBL Discounts side.

I have this working on TBL Tickets to TBL Tickets Sold on
the FRM Tickets Sold, but for some reason when I try it on
the FRM Discounts it's not working. I even had it working
last year and now suddenly it doesn't.

When I select a button the FRM Tickets it takes me to FRM
Discounts and automatically fills in the ID number. Then
it will let me enter information, however, it won't let me
save.

-----Original Message-----
I have a form that when I enter data I must have a related
record in another table. For instance I have TBL tickets
with a record "ID". When I enter in my form FRM Discounts
that saves to TBL Discounts, the record from TBL Tickets
with the "ID" will show on the screen so that I can see
what record FRM Discounts is related to. However, even
though I can see a valid record from TBL Tickets on FRM
Discounts, it will not let me save. It tells me I need a
related record in TBL tickets.

I'm not sure I made sense, but can anyone help me?

How are your two tables related? Does a record in [TBL Tickets] have
zero, one, or more corresponding records in [TBL Discounts]? (Note
that there ARE no records in FRM Discounts - Forms are display and
editing tools, data is stored only in tables).

What you might want to do is make the Discounts form a Subform of the
Tickets form, using the ID as the master/child link field. This will
ensure that the ID gets copied to any new record entered on the
subform. It is neither necessary nor wise to automatically create an
empty "placeholder" record in the Discounts table though - create a
record, with the ID, when you have data to put into it, not before!

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
.
 
My forms are related by "ID".

AGAIN:

Forms ARE NOT TABLES.

Forms don't have relationships. Forms don't store data. Forms are just
windows, tools to be used to view and edit data!
The "ID" in TBL Tickets is
a one to many on the TBL Discounts side.

I have this working on TBL Tickets to TBL Tickets Sold on
the FRM Tickets Sold, but for some reason when I try it on
the FRM Discounts it's not working. I even had it working
last year and now suddenly it doesn't.

When I select a button the FRM Tickets it takes me to FRM
Discounts and automatically fills in the ID number. Then
it will let me enter information, however, it won't let me
save.

You'll need to post the VBA code (or the Macro) executed by the
button, and the Recordsource properties of both forms. If you recheck
my previous post, I'd *really* recommend that you consider using FRM
Discounts as a Subform on FRM Tickets; with the Subform, you need no
button, no code, no hassles - just start typing in the subform and it
fills in the ID all by itself!

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
John:

You're right ... forms are not related ... tables are ...
therefore, I should have said my "tables" are related by
id.
 
Back
Top