Table Record Changes Automatically

T

TeeSee

This could be confusing!
I have a couple of pop up forms that appear when I click on a button
to add pricing for a specific customer and for a specific item. This
would be a discount from a list price. The first form is okay I think.
The second form "frmCustomerDiscountPU" is a form/subform linked by
field [MaterialSubGroup] The form shows currrently applied discounts
for all cutomers for the [MaterialSubGroup]. All works as expected up
to here.
The problem arises when I realize that the item I am trying to price
out has never been priced for this customer before so I want to add
the discount and effective date to the table that holds the data for
"frmCustomerDiscountPU". I open "frmCustomerDiscountsAdd" and add the
data which is stored correctly to the table but the field
[MaterialSubGroup] on the first record in the table changes to
whatever the [MaterialSubGroup] equals on the form
"frmCustomerDiscountPU" which remains open. If that form is not open
this doesn't happen ( I'm sure there's a hint there)

Is it a nono to have two forms open at the same time bound to the same
table?
Is the answer to this to first close "frmCustomerDiscountPU" before
updating the table?
Why would the first record always change under the conditions above.
Even if the [MaterialSubGroup] is blank it changes the first record to
blank.

Hope this makes sense. Thanks
 
J

John W. Vinson

This could be confusing!
I have a couple of pop up forms that appear when I click on a button
to add pricing for a specific customer and for a specific item. This
would be a discount from a list price. The first form is okay I think.
The second form "frmCustomerDiscountPU" is a form/subform linked by
field [MaterialSubGroup] The form shows currrently applied discounts
for all cutomers for the [MaterialSubGroup]. All works as expected up
to here.
The problem arises when I realize that the item I am trying to price
out has never been priced for this customer before so I want to add
the discount and effective date to the table that holds the data for
"frmCustomerDiscountPU". I open "frmCustomerDiscountsAdd" and add the
data which is stored correctly to the table but the field
[MaterialSubGroup] on the first record in the table changes to
whatever the [MaterialSubGroup] equals on the form
"frmCustomerDiscountPU" which remains open. If that form is not open
this doesn't happen ( I'm sure there's a hint there)

Is it a nono to have two forms open at the same time bound to the same
table?
Is the answer to this to first close "frmCustomerDiscountPU" before
updating the table?
Why would the first record always change under the conditions above.
Even if the [MaterialSubGroup] is blank it changes the first record to
blank.

Hope this makes sense. Thanks

I think the problem is that your combo box that you use to find the record to
be updated is in fact bound to the table field. A combo box has two different
functions; it can *update* an existing record (the first record in the table,
if you don't select it otherwise, simply because that's what's displayed on
the form); or it can *navigate* to a different record.

In the first function, the combo must be "bound" to the field - its control
source would be the fieldname.

For the navigation function, the combo must be *unbound* - have nothing in its
control source.

You may need two different combos to do the two different functions.
 
T

TeeSee

This could be confusing!
I have a couple of pop up forms that appear when I click on a button
to add pricing for a specific customer and for a specific item. This
would be a discount from a list price. The first form is okay I think.
The second form "frmCustomerDiscountPU" is a form/subform linked by
field [MaterialSubGroup] The form shows currrently applied discounts
for all cutomers for the [MaterialSubGroup]. All works as expected up
to here.
The problem arises when I realize that the item I am trying to price
out has never been priced for this customer before so I want to add
the discount and effective date to the table that holds the data for
"frmCustomerDiscountPU". I open "frmCustomerDiscountsAdd" and add the
data which is stored correctly to the table but the field
[MaterialSubGroup] on the first record in the table changes to
whatever the [MaterialSubGroup] equals on the form
"frmCustomerDiscountPU" which remains open. If that form is not open
this doesn't happen ( I'm sure there's a hint there)
Is it a nono to have two forms open at the same time bound to the same
table?
Is the answer to this to first close "frmCustomerDiscountPU" before
updating the table?
Why would the first record always change under the conditions above.
Even if the [MaterialSubGroup] is blank it changes the first record to
blank.
Hope this makes sense. Thanks

I think the problem is that your combo box that you use to find the record to
be updated is in fact bound to the table field. A combo box has two different
functions; it can *update* an existing record (the first record in the table,
if you don't select it otherwise, simply because that's what's displayed on
the form); or it can *navigate* to a different record.

In the first function, the combo must be "bound" to the field - its control
source would be the fieldname.

For the navigation function, the combo must be *unbound* - have nothing in its
control source.

You may need two different combos to do the two different functions.
--

             John W. Vinson [MVP]- Hide quoted text -

- Show quoted text -

John .... Thank you for responding. That is exactly what the problem
was. The Combo was in fact "bound" .... working like a charm now.
Thanks also for the explanation.
 

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