G
Guest
Feeling very stoopid today; help would be appreciated.
OK, I've a form with inventory information. What I'm trying to do is code a
loop that allows the user to just enter a certain amount of items, then
preforms that many iterations of the loop which writes a new record into a
table. The code works fine except for two issues:
1) One of the tables to which I'm writing uses an autonumber as a PK. I'm
not sure how to circumvent this; do I have to query the table to find the
highest number, increment that, then use that as the inserted value for that
field?
2) This is slightly embarrassing as this is about scope and I know I should
be able to dope this out. Anyway, at the click event of the "Add Record"
button, I've asked the system to capture the value of several text boxes.
However, I got a message indicating that the information from each text box
was unavailable as the focus was not there.
Even though I didn't think it would work, I jsut tried to stick the variable
declarations and assingments in the general declarations section, which gave
me a message indicating what I was trying to do was an "invalid outside
procedure".
So, do I have to, for each text value I want to capture, code a "Lost Focus"
procedure that captures that value and holds it, or within the code of my Add
Record button, do I have to programmatically send the focus to each text box,
then capture the value, or is there a more sensible way to capture all the
data in one fell swoop?
Thanks as always.
OK, I've a form with inventory information. What I'm trying to do is code a
loop that allows the user to just enter a certain amount of items, then
preforms that many iterations of the loop which writes a new record into a
table. The code works fine except for two issues:
1) One of the tables to which I'm writing uses an autonumber as a PK. I'm
not sure how to circumvent this; do I have to query the table to find the
highest number, increment that, then use that as the inserted value for that
field?
2) This is slightly embarrassing as this is about scope and I know I should
be able to dope this out. Anyway, at the click event of the "Add Record"
button, I've asked the system to capture the value of several text boxes.
However, I got a message indicating that the information from each text box
was unavailable as the focus was not there.
Even though I didn't think it would work, I jsut tried to stick the variable
declarations and assingments in the general declarations section, which gave
me a message indicating what I was trying to do was an "invalid outside
procedure".
So, do I have to, for each text value I want to capture, code a "Lost Focus"
procedure that captures that value and holds it, or within the code of my Add
Record button, do I have to programmatically send the focus to each text box,
then capture the value, or is there a more sensible way to capture all the
data in one fell swoop?
Thanks as always.