Help needed with form/sub-form

G

Guest

Hello,
I need some help with my form/sub-form. I'm just not getting it.

Master form (has 1 cbo and 3 txtboxes) is bound to Empl table. The cbo, an
emplNum is the PK/FK. The sub-form is based on a saved query and th emplNum
is the FK. Data on parent form should be read only and should change based
on the emplNum. If user selects a different emplNum, the values in the 2 txt
boxes and everything on the sub-form should change accordingly. Except for
the FK, all data on the sub-form should will be be modified.

The form is initially called from a menu. If the form is open, the use
change selects a different emplNum. I am passing the value of the key for
the first openign of the form via DoCmd.Open..... This is working fine.
however, when I attempt to select a diferent emplNum, I get a "Runtime error
3200 : The record cannot be deleted or changed because table <table name>
includes related records. "

I don't want to change another on the primary/master form. Can anyone help
me figure this out?

TIA,
Rich
 
M

Marshall Barton

rich said:
Master form (has 1 cbo and 3 txtboxes) is bound to Empl table. The cbo, an
emplNum is the PK/FK. The sub-form is based on a saved query and th emplNum
is the FK. Data on parent form should be read only and should change based
on the emplNum. If user selects a different emplNum, the values in the 2 txt
boxes and everything on the sub-form should change accordingly. Except for
the FK, all data on the sub-form should will be be modified.

The form is initially called from a menu. If the form is open, the use
change selects a different emplNum. I am passing the value of the key for
the first openign of the form via DoCmd.Open..... This is working fine.
however, when I attempt to select a diferent emplNum, I get a "Runtime error
3200 : The record cannot be deleted or changed because table <table name>
includes related records. "

I don't want to change another on the primary/master form. Can anyone help
me figure this out?


It sounds like you are confusing a data entry combo box with
a find record combo box. If your combo box is bound to the
emplnum field in the table, then you are changing the
employee's number every time you select a new entry in the
combo box, which is probably not a good idea.

I think you should probably remove whatever you have in the
combo box's ControlSource and move the combo box to the
form's header section. I also like to set the combo box's
BackColor to a pale green to let users know that this is not
a data entry control. Add a text box nound to the emplnum
field in the detail section so you can view/enter/edit an
emplyee's number. If you don't want users to change the
number, then Lock the text box.
 

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