Update / Add New Records

  • Thread starter Thread starter PBrown
  • Start date Start date
P

PBrown

I have tried every suggestion I could find on how to set
up a form that is using a combo box for record editing to
allow the user to add more records.
However, it seems that every time I enter a new record in
one form (add new), then close that form and reopen the
(update) form, the "new part number" is a choice but its
details will not appear. Or the new part number will
overwrite an existing part number and claim its detail as
well as make a duplicate part number of its self. Then
sometimes I get "Update or CancelUpdate with Add New or
Edit".

Below are is the table and its fields that I need to
update:
Table: Service Parts & Volume
Fields:
Part Number
Part Description
Std Mins
Location
CPU
Current Month

Please, this have been a "thorn in my neck" for about a
week. I will do almost anything, if it takes code, please
provide as much detail as possible since I do not deal
with code that often.

Thank you!!!

PBrown
 
P Brown,

I'm not sure exactly how you are doing this, but here is a
suggestion:

1. Be sure that the combo box on the "update" form is an
unbound control. Set the record source to the field you
want in the combo box, but leave the combo box unbound.
If it's bound (e.g., to part number), every time you pull
down a different value, it will update the current record.

2. On the "add" form, be sure that all of the controls
are bound to the table. I recommend making the "add" form
a data entry form (set data entry property to Yes). This
will only allow new additions and not overwrite any
existing records

Hope this helps....

Chris M.
 
I have tried every suggestion I could find on how to set
up a form that is using a combo box for record editing to
allow the user to add more records.

Well... that's not its function. A combo box can be used (commonly) in
two ways:

- a Bound combo box is used to enter data, or update data, in a field.
Typically this will be a "lookup" - the field in the table will be a
numeric ID, and the combo box will display human-meaningful text. The
Bound Column field of the combo will be written to the Control Source
field in the form's recordsource table or query, updating that field
in the current record.

- Or, you can use an Unbound combo box as a navigation tool. The combo
would have a (in this case) Part Number as its bound column, but would
have NOTHING in its Control Source property. Instead you would have
VBA code in the AfterUpdate event of the combo to read the selected
part number and navigate to that record. The Combo Box Wizard will
write this code for you if you select the option "use this combo to
find a record".
However, it seems that every time I enter a new record in
one form (add new), then close that form and reopen the
(update) form, the "new part number" is a choice but its
details will not appear.

How are these forms related? Both the same table? If so, why two
forms? Or are you "add new"ing a new Part, and then want to select
that part number in a different table?
Or the new part number will
overwrite an existing part number and claim its detail as
well as make a duplicate part number of its self. Then
sometimes I get "Update or CancelUpdate with Add New or
Edit".
Below are is the table and its fields that I need to
update:
Table: Service Parts & Volume
Fields:
Part Number
Part Description
Std Mins
Location
CPU
Current Month

Please, this have been a "thorn in my neck" for about a
week. I will do almost anything, if it takes code, please
provide as much detail as possible since I do not deal
with code that often.

Is this the Parts table? What is its Primary Key - Part Number? What
are the two forms (as asked above)? Could you explain step by step
what you WANT to happen?
 
Back
Top