PDA

View Full Version : How to insert data in the end.



musman
07-31-2007, 10:05 AM
hey,
I have a form that is reading the data from the database. and the form is bound with the databse.
I dont need to press any button to view next record as if i roll mouse's ball.The next data comes from the databse.
now i wanna add new data in the fields. and i wanna reach the last record with the blank spaces in the controls.
How could i do that?

mattj
07-31-2007, 01:27 PM
You could use the New Record record selector at the bottom of the form (if the record selector property is set to yes), or you could use a command button on your form that uses the VBA GoToRecord command to go to a new blank record.
I believe that if you use the command button wizard, one of the "Record" options is to create a new record.

HTH
Matt

musman
07-31-2007, 01:37 PM
Yes, The allow additions property is 'yes'. but still that lil button is disable and apprearing in grey..
well, i have created a new form that is having all of the same controls in previous form but when i do
Me.recordsource = tblename
it doenst show any control on the form..
but when i dont do it
it shows but doing so i loose the way to enter the data in the last field.

so is there any way that despite of binding my form with the data i could insert the data in the end.

mattj
08-01-2007, 11:54 AM
I'm not sure what you are trying to do by setting the recordsource in VBA - why not bind the form to the table and leave it?
If the new record selector is greyed out, verify that Allow Additions and Allow Edits is set to true. If you are basing this form on a query, another possibility is that you have created a non updateable recordset (usually happens when more than one table is included in the recordsource, or if the query includes any aggregate functions.

HTH
Matt

musman
08-01-2007, 11:59 AM
I m using RecordSource property of the form to bind the table with the form.
But doing this no control is shown in the design view but when i make this property blank then the controls are shown but i couldn't enter my data in it.
and ALlow Addition and Allow Edits both are yes..
but i dont know why the button is still grey.

mattj
08-01-2007, 12:20 PM
This usually indicates that you do not have write access to the table in question. Are you able to maunally add records to the table?

musman
08-01-2007, 12:32 PM
Yes manually i could.

mattj
08-02-2007, 05:05 AM
Try creating a new form using the form wizard. The controls may not be visible because you have not actually bound the controls the the fields in the recordsource.