PC Review


Reply
Thread Tools Rate Thread

Can't add a new record in Form View

 
 
Stuart Grant
Guest
Posts: n/a
 
      2nd Jan 2007
I have a database with one main form which has 9 text boxes and two combos
which list the details of each record as you step through them in a list box
with a list of all the last names. I also have command buttons for Add New
Record, Delete Record, Print and Quit.
The code for the AddNew Record button is

Private Sub AddNew_Click()
DoCmd.GotoRecord , , acNewRec
.......
.......
End Sub

It used to work but now when I click the boxes all go blank. I can select
an item from the first combo but when I tab to a text box, I cannot enter
anything. The text boxes are not locked but none of them will allow me to
enter anything. What can be wrong ?

I did not have navigation buttons in the form but have tried adding them.
Same problem.

Stuart


 
Reply With Quote
 
 
 
 
Van T. Dinh
Guest
Posts: n/a
 
      2nd Jan 2007
1. Have you changed the RecordSource Query / SQL recently?
If you have, the RecordSource Query / SQL might have become non-updatable
and you can't add record using a non-updatable Query?

Open the DatasheetView of the Query / SQL and see if you can modify / add
record.

2. Have you check the AllowAdditions Property of the Form?


--
HTH
Van T. Dinh
MVP (Access)



"Stuart Grant" <sagranatbluewin.ch> wrote in message
news:OX%(E-Mail Removed)...
>I have a database with one main form which has 9 text boxes and two combos
>which list the details of each record as you step through them in a list
>box with a list of all the last names. I also have command buttons for Add
>New Record, Delete Record, Print and Quit.
> The code for the AddNew Record button is
>
> Private Sub AddNew_Click()
> DoCmd.GotoRecord , , acNewRec
> ......
> ......
> End Sub
>
> It used to work but now when I click the boxes all go blank. I can select
> an item from the first combo but when I tab to a text box, I cannot enter
> anything. The text boxes are not locked but none of them will allow me to
> enter anything. What can be wrong ?
>
> I did not have navigation buttons in the form but have tried adding them.
> Same problem.
>
> Stuart
>



 
Reply With Quote
 
Stuart Grant
Guest
Posts: n/a
 
      2nd Jan 2007
Thanks for jumping in.
The Allow Additions Property of the Form Is YES.
I have not altered the Record Source Query recently but looked at it in
Datasheet view. I can modify it - but, you are right, I cannot add to it.
How did it become not updatable ?
Stuart

"Van T. Dinh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 1. Have you changed the RecordSource Query / SQL recently?
> If you have, the RecordSource Query / SQL might have become non-updatable
> and you can't add record using a non-updatable Query?
>
> Open the DatasheetView of the Query / SQL and see if you can modify / add
> record.
>
> 2. Have you check the AllowAdditions Property of the Form?
>
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>


 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      2nd Jan 2007
Can you see the "New Record" row in the DatasheetView of the Query?

Please post the details of the relevant Table(s) and the SQL String of the
RecordSource Query.

--
HTH
Van T. Dinh
MVP (Access)



"Stuart Grant" <sagranatbluewin.ch> wrote in message
news:(E-Mail Removed)...
> Thanks for jumping in.
> The Allow Additions Property of the Form Is YES.
> I have not altered the Record Source Query recently but looked at it in
> Datasheet view. I can modify it - but, you are right, I cannot add to it.
> How did it become not updatable ?
> Stuart
>



 
Reply With Quote
 
Stuart Grant
Guest
Posts: n/a
 
      3rd Jan 2007
Yes, I can see the "New Record" in the Datasheet View of the Query. I can
go to this row direct or with the * button, but cannot enter anything. The
first column stays at (AutoNumber). It should go to 79 when you tab to the
next column. It doesn't and I can't enter anything in any of the other
columns.

The SQL String is as follows -
SELECT [Personal Data].RecNo, [Personal Data].FirstName, [Personal
Data].LastName, [Personal Data].Address1, [Personal Data].Address2,
[Personal Data].Address3, [Personal Data].Telephone1, [Personal
Data].Telephone2, [Personal Data].Partner, [Personal Data].Notes,
Countries.Country, Titles.Title
FROM Titles INNER JOIN (Countries INNER JOIN [Personal Data] ON
Countries.CountryID=[Personal Data].CountryID) ON Titles.TitleID=[Personal
Data].TitleID;

From this you can see the details of the tables. Most of the information is
in Personal Data. Countries and Titles provide the data for the two combos.

I'm sure Data Entry worked before. I'm baffled as to why it no longer does.

Stuart

"Van T. Dinh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can you see the "New Record" row in the DatasheetView of the Query?
>
> Please post the details of the relevant Table(s) and the SQL String of the
> RecordSource Query.
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>
>



 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      3rd Jan 2007
SQL that involve more than 2 Tables are often not updatable. Check Access
Help topic "Updatable Queries".

Since you store the TitleID and CountryID in the Table [Personal Data], my
recommendation is to get rid of the Tables [Titles] and [Countries] from the
Form's RecordSource, i.e. the RecordSource only has the Table [Personal
Data] and on the Form, use ComboBoxes to show and to allow user to select
Title / Country by text but the BoundColumns of the ComboBoxes are the
Fields [TitleID] and [CountryID] so that the ID values are sotred in the
Table [Personal Data].

--
HTH
Van T. Dinh
MVP (Access)




"Stuart Grant" <sagranatbluewin.ch> wrote in message
news:(E-Mail Removed)...
> Yes, I can see the "New Record" in the Datasheet View of the Query. I can
> go to this row direct or with the * button, but cannot enter anything.
> The first column stays at (AutoNumber). It should go to 79 when you tab to
> the next column. It doesn't and I can't enter anything in any of the
> other columns.
>
> The SQL String is as follows -
> SELECT [Personal Data].RecNo, [Personal Data].FirstName, [Personal
> Data].LastName, [Personal Data].Address1, [Personal Data].Address2,
> [Personal Data].Address3, [Personal Data].Telephone1, [Personal
> Data].Telephone2, [Personal Data].Partner, [Personal Data].Notes,
> Countries.Country, Titles.Title
> FROM Titles INNER JOIN (Countries INNER JOIN [Personal Data] ON
> Countries.CountryID=[Personal Data].CountryID) ON Titles.TitleID=[Personal
> Data].TitleID;
>
> From this you can see the details of the tables. Most of the information
> is in Personal Data. Countries and Titles provide the data for the two
> combos.
>
> I'm sure Data Entry worked before. I'm baffled as to why it no longer
> does.
>
> Stuart
>



 
Reply With Quote
 
Stuart Grant
Guest
Posts: n/a
 
      4th Jan 2007
Van: Thank you for the advice.
I still don't understand why it no longer works and I found the Help files
hard to understand. No matter.
I followed your advice and of course it works . Problem solved.
Thank you for your patience.
Stuart

"Van T. Dinh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> SQL that involve more than 2 Tables are often not updatable. Check Access
> Help topic "Updatable Queries".
>
> Since you store the TitleID and CountryID in the Table [Personal Data], my
> recommendation is to get rid of the Tables [Titles] and [Countries] from
> the Form's RecordSource, i.e. the RecordSource only has the Table
> [Personal Data] and on the Form, use ComboBoxes to show and to allow user
> to select Title / Country by text but the BoundColumns of the ComboBoxes
> are the Fields [TitleID] and [CountryID] so that the ID values are sotred
> in the Table [Personal Data].
>
> --
> HTH
> Van T. Dinh
> MVP (Access)



 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      4th Jan 2007
I always try to make Forms being used for data entry / data edit as simple
as possible since it is generally more than enough trying to predict the
user's actions. Lot of developers got stuck because they think the users
will follow a certain logical path (same as the developers' logical path)
for data entry / data edit but invariably, the users will do something
different.

Glad you got it working.

--
Van T. Dinh
MVP (Access)



"Stuart Grant" <sagranatbluewin.ch> wrote in message
news:(E-Mail Removed)...
> Van: Thank you for the advice.
> I still don't understand why it no longer works and I found the Help files
> hard to understand. No matter.
> I followed your advice and of course it works . Problem solved.
> Thank you for your patience.
> Stuart
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
select a record using datasheet view, then use form view to edit =?Utf-8?B?QVZOMTk3MA==?= Microsoft Access Forms 1 27th Apr 2007 11:32 PM
add new record in form view =?Utf-8?B?UGV0ZXI=?= Microsoft Access Forms 2 27th Apr 2007 02:34 PM
View only one record on a form =?Utf-8?B?YXZlcnlxdWVzdGlvbg==?= Microsoft Access Form Coding 3 21st Mar 2006 02:49 PM
Access 97 Click button in form and view the report of a selected record in sub-form Céline Brien Microsoft Access Form Coding 5 27th May 2004 09:50 PM
Add new record in form view. =?Utf-8?B?U3RlcGhlbg==?= Microsoft Access Queries 1 12th Apr 2004 08:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:31 PM.