Whacky "Overflow" error drives DBase manager nuts

G

Guest

Background: I have a DBase that works with 3 dealers issuing debt for my company. The share each dealer has placing our debt is represented by decimals >=0 and <=1, all of which (should) add to 1. In the form I have built to input which dealer places how much debt, I set up three text boxes with no control sources. When the user puts in an amount for one of the dealers to sell, a macro divides the number by the FaceAmount (the total amount of debt being placed, also a field in the record), and uses an Update Query to place this decimal in the appropriate record and field.

Problem: When I first enter a 'new' record in the form, whenever I try to update the dealer text boxes, I get an "Overflow" error. It works only after to another record, and then going back to the 'new' record.

Hypothesis: I think the problem is that the record is not completed before the user enters a value that runs the Update Query, which then causes the "Overflow" error. This seems to be supported by the fact that the user can go to a different record (updating the record in question), and go back to the original one, and then successfully enter the data s/he needs to.

Solution: This is where I turn to you, the Access community-at-large for help. Any suggestions on how to proceed with this issue? I understand this is a less-specific, more broad-overview sort of issue. Any suggested happily welcomed. If you need any further info on the issue, please let me know.

Thanks in Advance,
Nick
 
A

Albert D. Kallal

In fact, as a good programming practice, anytime I have a button from a form
(that lets you edit data), I ALWAYS write that data to disk.

If I launch another form, report, or run a process, it only makes sense to
write the current data (record) out to disk. Even in some cases where I
don't for "sure" have to write the record out, I simply do so anyway.
Anytime some other process runs, you have a "point" in which something can
go wrong(computer freeze up etc). If I written my data to disk, then you
don't loose any data.

So, simply put in a me.refresh "right" before you run that query.

If your design of your application allows more then one record to be
attached to the form, then a good many developers suggest to use:


If me.Dirty = true then
me.Dirty = false
end if

Both me.refresh and the above code do write to disk, but me.Refresh can
result in more network traffic as it also looks for updates (this does not
matter to me, since my designs RARELY have record navigation buttons
anyway). So, in place of me.Refresh, the above code is a better choice.
 

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