Data from Form to Table

  • Thread starter Thread starter Cranky
  • Start date Start date
C

Cranky

Hello

I've read through similar threads but can't find the answer I need.

It's a 2-parter, I'm afraid.

I have a form for recording numbers of visitors to my office. The date
is set by a calendar control.

1: The first time I test the form's Save button, it works fine.
However, subsequent records using different dates are not recorded. EG,
08/06/05, all visits sent to the table correctly. If I go then try to
save 09/06/05, nothing happens.

The code set to the button is -

DoCmd.RunCommand acCmdSaveRecord

What have I done wrong?

and

2: If I was later to select 08/06/05 again, how would I go about the
form showing previously stored data and overtyping any amendments when
saved?

Thanks in advance

Steve
 
Cranky said:
Hello

I've read through similar threads but can't find the answer I need.

It's a 2-parter, I'm afraid.

I have a form for recording numbers of visitors to my office. The date
is set by a calendar control.

1: The first time I test the form's Save button, it works fine.
However, subsequent records using different dates are not recorded.
EG, 08/06/05, all visits sent to the table correctly. If I go then
try to save 09/06/05, nothing happens.

The code set to the button is -

DoCmd.RunCommand acCmdSaveRecord

What have I done wrong?

I think you are first working too hard. Normally you would not need a
save button.
Microsoft Access automatically saves the record you are adding or editing as
soon as you move the insertion point to a different record, or close the
form you are working on.

I suspect that if you use the page up or down keys a few times you will
see those records. Have you opened the table to see if they are there? I
am assuming that your form is based on a table or a query based on a table
and that the query is not filtering out those other records.



and

2: If I was later to select 08/06/05 again, how would I go about the
form showing previously stored data and overtyping any amendments when
saved?

Just open the form and find the record (a number of ways of finding
records) then make any amendments you would like and either close the form
or move to another record and the changes will be saved.
 
Joseph said:
Just open the form and find the record (a number of ways of finding
records) then make any amendments you would like and either close the form
or move to another record and the changes will be saved.

Trying to use a 'Save' button was partly an aesthetic thing, and partly
because the person using it is prone to overtyping data by mistake. I
know that if she had the record navigation buttons she would overtype
some data. I know how facetious I sound saying that, but it's true. I'm
looking for a solution where she would have to consciously save the
current data - there would be an 'are you sure?' type messagebox as
well.

Thanks

Steve
 
Cranky said:
Trying to use a 'Save' button was partly an aesthetic thing, and
partly because the person using it is prone to overtyping data by
mistake. I know that if she had the record navigation buttons she
would overtype some data. I know how facetious I sound saying that,
but it's true. I'm looking for a solution where she would have to
consciously save the current data - there would be an 'are you sure?'
type messagebox as well.

Thanks

Steve

I have not done this but I would guess the answer is to create a form
with bound controls (showing the data as it is) and unbound controls where
they can enter the new data. Protect the bound controls so they can not
edit them or better even enter them. Then after they are done entering the
new (replacement) data, the button could pull up a new form over the current
one with two buttons (Yes and No) along with the message "You are about to
change data. Are you sure?" The no button could just close that form and
the yes could update the current record and clear the un-bound controls.
 
Cranky said:
Trying to use a 'Save' button was partly an aesthetic thing, and partly
because the person using it is prone to overtyping data by mistake. I
know that if she had the record navigation buttons she would overtype
some data. I know how facetious I sound saying that, but it's true. I'm
looking for a solution where she would have to consciously save the
current data - there would be an 'are you sure?' type messagebox as
well.

To prevent "accidents" I would recommend locking the form and providing a button
that unlocks it for editing. That way the user has to intend to make changes by
pressing the [Edit] button. This method works equally well for forms with
subforms whereas "Are you sure?" strategies don't work with subforms very well
at all.
 

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

Similar Threads

Repeat the value from the previous record 6
Pulling from three tables 5
How to sum 2
sorting a query 7
In a pickle! 6
Data Parsing from Text Box 8
Dlookup 7
Pick last entered records from table 7

Back
Top