Join table and subforms

  • Thread starter Bill R via AccessMonster.com
  • Start date
B

Bill R via AccessMonster.com

I'm having difficulty executing the forms for a normalized db. It would be
nice to include a print screen of the relationships, but that's not possible
here. So I will try to explain it as best I can.

I have a continuous subform within a single subform within yet another single
subform. That works fine. Now I want to take that subform and make it a
subform for the main form. The data in this mainform/subform is many-many.
tblDrawings has a DWGID and tblMSDSs has an MSDSID. The join table between
them has 2 fields, dwgid and msdsid, both foreign keys for the other 2 tables.
I based the main form on the join table. I have a Drawings combo box on the
main form bound to the dwgid, and I want to link the MSDS subform to the
msdsid of the main form. I have an after update procedure in the Drawings
combo that looks like this:

Private Sub cmbSelectDwg_AfterUpdate()

With Me
.txtDWGID = .cmbSelectDwg
.lblDwg.Caption = .cmbSelectDwg.Column(1)
.lblDwg.Visible = True
.cmdClose.SetFocus
.cmbSelectDwg.Visible = False
.cmdNGCDwgs.Visible = False
End With
DoCmd.RunCommand acCmdSaveRecord
End Sub

I added the acCmdSaveRecord in a vain attempt to permit creation of an MSDS
record in the subform after entering a dwgid in the join table. I was
thinking that after I have the dwgid in the join table by selecting a drawing
in the combo, I could then create an MSDS record and have it's MSDSID bound
to the msdsid in the join table. Of course, it doesn't work, or why would I
be bugging you with it? ;-)

Please advise.

Bill
 

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