Edit button and no adds

D

d9pierce

Hi all,
I have looked through a lot of threads but cannot find an answer to
most likely a simple question?

When I click on a button I have to edit a record, a form opens in edit
mode and specifies filtered 1 record. Now if you use the mouse or
selection arrows, it will go to a blank record. Is there anyway to
prevent this from happening? Just to remove anything but that 1
record?
Thanks
Dave
 
J

Jeanette Cunningham

Dave,
first thing to try is to open the edit form in design view, on the form's
property dialog, choose the Other tab.
Find Cycle and set it to Current Record instead of All Records.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

d9pierce

Dave,
first thing to try is to open the edit form in design view, on the form's
property dialog, choose the Other tab.
Find Cycle and set it to Current Record instead of All Records.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia







- Show quoted text -

Thank you so much, I will give that a try!
 
D

d9pierce

Hi, gave that a try and didnt seam to change anything. I can still
scroll with mouse to a new record or blank, of course one cant add a
new record but it goes to a blank record. There should be a way to not
allow this to happen?
Thanks
Dave
 
C

Cheese_whiz

Hi,

Check the 'allow additions' property of the form and set it to 'no' if it's
not already.

Open the form in design view. Open the properties window. On the 'data'
tab, find the 'allow additions' property.

HTH,
CW
 
A

AndrewOfAzotus

Hi all,
I have looked through a lot of threads but cannot find an answer to
most likely a simple question?

When I click on a button I have to edit a record, a form opens in edit
mode and specifies filtered 1 record. Now if you use the mouse or
selection arrows, it will go to a blank record. Is there anyway to
prevent this from happening? Just to remove anything but that 1
record?
Thanks
Dave

Assuming this form is never opened with a filter unless you want to display
one record, try:

me.allowadditions = (me.filter > "")

in Form_Open.

If you do use other filters then if the filter is Fld = 12 you could try

me.allowadditions = not (left(me.filter,5) = "Fld =")

but this will only work if you never user Fld = 12 and <something else>

you could also try calling it with a filter of Fld = 12 when you want to
allow additions and [Fld] = 12 when you don't which would then allow:

me.allowadditions = not (left(me.filter,1) = "[")

finally, if all of these are no good then try calling the form with openargs
of, say, "NoEdit"

me.allowadditions = Not (Me.openArgs = "NoEdit")

Andrew/
 
J

Jeanette Cunningham

I just checked this in one of my apps.
A2003 in A2000 format.
SP3 and hotfix applied.

I have a form that is opened from another form using a where clause and in
edit mode.
This form has its allow edits set to yes and allow additions set to yes and
data entry set to yes.

DoCmd.OpenForm "frmAddAssPtB", , , "[TrID] = " & Me.cboTrID & "", acEdit

The form called frmAddAssPtB opens to show only the one record with the
matching TrID.
Opening it as acEdit tells it to open in edit mode.

It has cycle set to current record.
There is no code to turn off the mouse wheel.
The form stays on the same record whether you press the tab key, the up and
down arrows or the mouse wheel.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
A

AndrewOfAzotus

AndrewOfAzotus said:
Hi all,
I have looked through a lot of threads but cannot find an answer to
most likely a simple question?

When I click on a button I have to edit a record, a form opens in edit
mode and specifies filtered 1 record. Now if you use the mouse or
selection arrows, it will go to a blank record. Is there anyway to
prevent this from happening? Just to remove anything but that 1
record?
Thanks
Dave

Assuming this form is never opened with a filter unless you want to display
one record, try:

me.allowadditions = (me.filter > "")

in Form_Open.

If you do use other filters then if the filter is Fld = 12 you could try

me.allowadditions = not (left(me.filter,5) = "Fld =")

but this will only work if you never user Fld = 12 and <something else>

you could also try calling it with a filter of Fld = 12 when you want to
allow additions and [Fld] = 12 when you don't which would then allow:

me.allowadditions = not (left(me.filter,1) = "[")

finally, if all of these are no good then try calling the form with openargs
of, say, "NoEdit"

me.allowadditions = Not (Me.openArgs = "NoEdit")

Andrew/

Sorry, that last openargs should have been "NoAdd"

Sigh

Andrew/
 
D

d9pierce

I just checked this in one of my apps.
A2003 in A2000 format.
SP3 and hotfix applied.

I have a form that is opened from another form using a where clause and in
edit mode.
This form has its allow edits set to yes and allow additions set to yes and
data entry set to yes.

DoCmd.OpenForm "frmAddAssPtB", , , "[TrID] = " & Me.cboTrID & "", acEdit

The form called frmAddAssPtB opens to show only the one record with the
matching TrID.
Opening it as acEdit tells it to open in edit mode.

It has cycle set to current record.
There is no code to turn off the mouse wheel.
The form stays on the same record whether you press the tab key, the up and
down arrows or the mouse wheel.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




Hi, gave that a try and didnt seam to change anything. I can still
scroll with mouse to a new record or blank, of course one cant add a
new record but it goes to a blank record. There should be a way to not
allow this to happen?
Thanks
Dave- Hide quoted text -

- Show quoted text -

Perfect, thank you so much!
 

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