By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Continuous Form-Staying on current record

P: n/a
Hi everyone:
This is probably a pretty simple problem but it is driving me nuts.

Using Access 2000. I have a continuous form which list several
thousand inventory items. The user can enter a order quantity on any
given line. I have several different error checks depending on what
the user enters in the quantity text box.

What I need is a way to keep the user on that current record if he has
any errors. This needs to be done if he tabs or clicks to a different
record. If there is an error he needs to be positioned back to the
record that caused the error.

Need a solution that would work in the error occurs on the first
record, the last record, any record inbetween or if there is only one
record on the continuous form.

Any help would be appreciated.

Apr 27 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
eighthman11 wrote:
Hi everyone:
This is probably a pretty simple problem but it is driving me nuts.

Using Access 2000. I have a continuous form which list several
thousand inventory items. The user can enter a order quantity on any
given line. I have several different error checks depending on what
the user enters in the quantity text box.

What I need is a way to keep the user on that current record if he has
any errors. This needs to be done if he tabs or clicks to a different
record. If there is an error he needs to be positioned back to the
record that caused the error.

Need a solution that would work in the error occurs on the first
record, the last record, any record inbetween or if there is only one
record on the continuous form.

Any help would be appreciated.
Pull up the property sheet for the form, go to the Other tab, and set
Cycle to Current record.

Under the Events tab for the form in the BeforeUpdate event you might
have something like this
Cancel = True
If IsNull(CustName) Then
Msgbox "Name required"
Me.CustName.setfocus
Elseif OrderAmt < 0 then
msgbox "Amt must be greater than 0
Me.OrderAmt.SetFocus
Else
Cancel = False
Endif

It must pass the error checks before it will save the record data.
Apr 27 '07 #2

P: n/a
Use the Form_BeforeUpdate event to do your error-checks. If a check fails,
set Cancel = True. The focus will remain on the current record.

"eighthman11" <rd******@nooter.comwrote in message
news:11**********************@b40g2000prd.googlegr oups.com...
Hi everyone:
This is probably a pretty simple problem but it is driving me nuts.

Using Access 2000. I have a continuous form which list several
thousand inventory items. The user can enter a order quantity on any
given line. I have several different error checks depending on what
the user enters in the quantity text box.

What I need is a way to keep the user on that current record if he has
any errors. This needs to be done if he tabs or clicks to a different
record. If there is an error he needs to be positioned back to the
record that caused the error.

Need a solution that would work in the error occurs on the first
record, the last record, any record inbetween or if there is only one
record on the continuous form.

Any help would be appreciated.

Apr 27 '07 #3

P: n/a
Thanks for the help. One more question. If the error check fails and
I do a cancel = true is there a way I can return the quantity order
back to its original value before the error check. I tried to set the
value in the beforeupdate event but it would not let me.
Apr 27 '07 #4

P: n/a
Assuming your control name for the quantity ordered field is 'txtOrderQty',
then:

Me.txtOrderQty.Undo

ought to do the trick.

"eighthman11" <rd******@nooter.comwrote in message
news:11*********************@n15g2000prd.googlegro ups.com...
Thanks for the help. One more question. If the error check fails and
I do a cancel = true is there a way I can return the quantity order
back to its original value before the error check. I tried to set the
value in the beforeupdate event but it would not let me.


Apr 27 '07 #5

P: n/a
On 27 Apr 2007 09:29:06 -0700, eighthman11 <rd******@nooter.comwrote:
>Thanks for the help. One more question. If the error check fails and
I do a cancel = true is there a way I can return the quantity order
back to its original value before the error check. I tried to set the
value in the beforeupdate event but it would not let me.
See post by Salad

Chuck
--
Apr 27 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.