Data Entry Only

A

Ann

Hi,

I hope someone will have some ideas for what I need. I have a form with a
save button for each new record. I need the save button at the time it's
clicked to bring up a message box asking if they are certain they want to
save the record (yes or no). If they say no they have to stay on the record
to change what is wrong. If they say yes I need the record to be written to
the table but no longer available to go back to in the form. I tried using
the data entry property but I can still go back to the previous records
entered.

Is there a way to create a form without a table or query but still have text
boxes that I can put the data into the correct table/field once the save
button is clicked? Thanks for any help that can be given.
 
B

Banana

Ann said:
Hi,

I hope someone will have some ideas for what I need. I have a form with a
save button for each new record. I need the save button at the time it's
clicked to bring up a message box asking if they are certain they want to
save the record (yes or no). If they say no they have to stay on the record
to change what is wrong. If they say yes I need the record to be written to
the table but no longer available to go back to in the form. I tried using
the data entry property but I can still go back to the previous records
entered.

Is there a way to create a form without a table or query but still have text
boxes that I can put the data into the correct table/field once the save
button is clicked? Thanks for any help that can be given.

I suppose a simple way to do this is to set Data Entry to Yes and
disable Navigation Buttons and set Cycle property to Current Record only.

This should leave your users with no mean of navigating back and the
buttons you have right now will handle this.

Be aware, though, if they close the form with a partial record, you need
to trap for that.
 
A

Ann

I did try that and I can't move back to a previous record but the current
data is still showing in the fields. How do I clear out the data from the
fields after the record is saved?
 
L

Linq Adams via AccessMonster.com

Unless your users are using ten year old mice , you'll also need a routine to
prevent the use of the mouse wheel to navigate between records.

If you're running Access 2007, you already have a function that addresses
this issue! Just check with Help.

For all other versions, you'll need some outside help. A gentleman by the
name of Stephen Lebans has a sample database that does this and it can be
downloaded at:

http://www.lebans.com/mousewheelonoff.htm

First, download and unzip the db and take a look. Go into your db and goto
File > External Data > Import and import the module modMouseHook from the
sample database. Next make sure you have the included file, MouseHook.dll, in
the same folder your database resides in. The following code needs to run
before the mousewheel will be locked:

Private Sub Form_Load()
'Turn off Mouse Scroll
blRet = MouseWheelOFF
End Sub

If you have one form that always loads first in your db, place the code there.
If the first form to load varies, place the same code in each form.
 
L

Linq Adams via AccessMonster.com

In answer to your last question, simply move to a new record.
 
B

Banana

FWIW, I don't think it's always necessary to use code to disable mouse
wheels when setting the Cycle property to current record only will just do.
 
B

Banana

Ann said:
I did try that and I can't move back to a previous record but the current
data is still showing in the fields. How do I clear out the data from the
fields after the record is saved?

As Linq suggested, does your button actually have code to move the
pointer to a new record?
 
A

ADB_Seeker

Hello,
I followed your steps below and get compile error "Ambiguous name detected:
MouseWheelOFF". For the code to turn the mousewheel on, I get compile error
"Ambiguous name detected: MouseWheelON".
I imported modMouseHook into my database and I placed the .dll in the folder
where my database resides.
Thanks in advance for your help.
Linda
 
D

Douglas J. Steele

That implies that you already had modules named MouseWheelON and
MouseWheelOFF somewhere in your application. Search for them, and get rid of
one set.
 
A

ADB_Seeker

Thank you so much!! It now works perfectly.

Douglas J. Steele said:
That implies that you already had modules named MouseWheelON and
MouseWheelOFF somewhere in your application. Search for them, and get rid of
one set.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)





.
 

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