EOF question

  • Thread starter Thread starter daniel
  • Start date Start date
D

daniel

in a form, I don't want the user to go to a new record when he is on the
last record..
if I use OnKeyDown or Press and set downkey to 0, that works but then it
will not let me add a new record
even with a 'Add new record' button.
what is the correct solution for that?
 
Hi Daniel,

Try to trap the error, see if this work for you.

err_handler_Exit:
Exit Sub
err_handler:
If Err.Number = 2105 Then 'trap the error code here
KeyCode = 0
Resume err_handler_Exit
Else
MsgBox Err.Number & "-" & Err.Description
End If
 
daniel said:
in a form, I don't want the user to go to a new record when he is on the
last record..
if I use OnKeyDown or Press and set downkey to 0, that works but then it
will not let me add a new record
even with a 'Add new record' button.
what is the correct solution for that?

In the form properties, on the data tab, turn Allow Additions to No.

Stephen B. Burris Jr.
 
if I set Allow Additions to No then it will not let me add a new record,
even with
the standard New record button.
that is not what I want.
I don't want the user to go to a new(empty) page when he is at the last
record and then hits the
PgDn key.

the way I am doing it now is:
form1 has New Account# button. (Allow Additions= No)
it opens form2 which has 3 empty fields, Account#, last and first name.
form2 closes form 1.
fill in the empty fields in form2, press Update.
form1 opens with the new Account#, form 2 closes. I can fill in the rest of
the fields in form1..
all that works fine but I like to go around closing form 1.
now, if I would leave form1 open and open form2, then form1 would have to go
to a new record also but will not, cause the Allow Addition is set to no.
only by closing form1 will it work.

I hope I wrote this to be understandable.

I have another question.
I saw a Delphi database. the form was a continious form.
it had certain lines colored.
I tried to do the same thing in Acess ( all with the Approved checkboxes to
yes and red background for Account#,
all not approved white background.).
but.... every line showed red backgrounds, no matter if they were yes or no.
is there a way to do this ?
 
Daniel,

You should limit each post to one question or (questions) about the one
problem.

daniel said:
if I set Allow Additions to No then it will not let me add a new record,
even with
the standard New record button.
that is not what I want.
I don't want the user to go to a new(empty) page when he is at the last
record and then hits the
PgDn key.

the way I am doing it now is:
form1 has New Account# button. (Allow Additions= No)
it opens form2 which has 3 empty fields, Account#, last and first name.
form2 closes form 1.
fill in the empty fields in form2, press Update.
form1 opens with the new Account#, form 2 closes. I can fill in the rest of
the fields in form1..
all that works fine but I like to go around closing form 1.
now, if I would leave form1 open and open form2, then form1 would have to go
to a new record also but will not, cause the Allow Addition is set to no.
only by closing form1 will it work.

I hope I wrote this to be understandable.

In the form properties, on the data tab, turn Allow Additions to No

On form 1, in the form properties, on the data tab, turn Allow Additions to
No.
Change the New Account# button code (or add a button) to

Me.AllowAdditions = TRUE

In the *form* Afterupdate event, set the Allow Additions back to No.

Me.AllowAdditions = FALSE



Another way would be for you to use a different (but Identical) form with
"Allow Additions " set to YES. Form 1 would still have "Allow Additions " set
to NO.


I have another question.
I saw a Delphi database. the form was a continious form.
it had certain lines colored.
I tried to do the same thing in Acess ( all with the Approved checkboxes to
yes and red background for Account#,
all not approved white background.).
but.... every line showed red backgrounds, no matter if they were yes or no.
is there a way to do this ?

It is possible. See "Conditional Formatting". Please repost the question
with more info about field names and what fields are the Approved checkboxes.


HTH
 
Back
Top