how to create a form with ADO or DAO

M

Marco

Hi. I would like to create a form that allow me to insert data into tables
but without using the default recorset of the form properties.

What happens with me is if someone enter in a form in Edit mode allows to
edit the information that appear in that form. The problem is that sometimes
users change the data and the access saves imediatly that data.

I would like to have a button that only change the data if I press update.
Or is there any option that "secure" the data and only if a button is pressed
the user had access to change the data?

Is any template with that?

Regards in advance,
Marco
 
D

Douglas J. Steele

Why not make the underlying query read-only?

You can do this by using an aggregate function such as Sum or Count in the
query. Instead of:

SELECT Field1, Field2, Field3
FROM MyTable

use

SELECT Field1, Field2, Field3, Count(*)
FROM MyTable
GROUP BY Field1, Field2, Field3
 
L

Larry Linson

Marco said:
Hi. I would like to create a form that allow me to insert data into tables
but without using the default recorset of the form properties.

What happens with me is if someone enter in a form in Edit mode allows to
edit the information that appear in that form. The problem is that
sometimes
users change the data and the access saves imediatly that data.

I would like to have a button that only change the data if I press update.
Or is there any option that "secure" the data and only if a button is
pressed
the user had access to change the data?

No template, and I don't have an example, but I'm sure there are some
examples available. Put code in the BeforeUpdate of the Form to use a MsgBox
function (not statement) to ask the user if they really want to update. I
find such delays to be aggravating, but perhaps your users are different.

It would be something like the following air-code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Response = MsgBox("Do you want to save?", vbYesNo +
vbDefaultButton2,"Save?")
If Response <> vbYes Then
Me.Undo
Cancel = True
End If
End Sub
 
T

Tony Toews [MVP]

Text that A a r o n K e m p f wrote snipped.
only retards and mariposa use DAO

Note that this person is really A a r o n K e m p f and that he is not an employee
of Microsoft.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

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