edit button

inbal

Registered User.
Local time
Today, 03:52
Joined
Feb 8, 2009
Messages
48
i have a tabular form i witch i defined data entry=no
i want a buuton at the end of each line, that by pressing it, ill be able to edit the line.
how do i program the button?
 
another button im tring to create is one that will save the data enterd in the form and empty the form so i can insert another line.
 
i have a tabular form i witch i defined data entry=no
i want a buuton at the end of each line, that by pressing it, ill be able to edit the line.
how do i program the button?

Put something like the following in the OnClick event of your button;

Code:
Me.AllowAdditions = True

You will also need some code to return this property back to False once you are done.
 
another button im tring to create is one that will save the data enterd in the form and empty the form so i can insert another line.

One way you could do this is to have an unbound form, and run an append query (on the button click) to move this data to your table, then after the query has run set all fields on the form to Null.
 
you lost me with the unbound form...
im new at this.
how can i set all feilds to null after pressing the button?
 
Put something like the following in the OnClick event of your button;

Code:
Me.AllowAdditions = True

You will also need some code to return this property back to False once you are done.

it doesnt change enything...
do i have to define the textboxes i want to allow edit?
 
You may not notice a visible change to how the DB looks, you will notice the change when you try to add items to the form.

Have a look at the attached DB for example that should answer last two posts.
 

Attachments

when i open the DB you attached it doesnt let me do eny changes...
the code line changes but i still cant add input.
 
i wrote the code in my DB
it lets me make changes now
but it doesnt get enabled again.
and one other question,
is it possible to allow changes for the specific row only?
(not for the whole table?)
 
Sorry, I must have had a brain explosion when I wrote that, as I'd put the code in the on current event, so it wasn't going to a new record. I've taken the code out of the On current event so it should work fine now.

All you can do is to turn the Allow edits to false when focus shifts from your current record. Given the code you already have it should just be a matter of implementing it when the focus shifts from the current record.
 

Attachments

do i have to write the code on lost focus for every feild or can i write it for the wole line together?
 
There are a number of ways you could tackle this. You could put some code in the last field in the tab order, so that when that field looses focus you switch the allow edits to false.

Alternatively you could send the focus back to the first field in the tab list, so you stay on the same record. Then have buttons to navigate to the previous or next, and set allow edits to false at that point.

There are undoubtedly other option available too.
 

Users who are viewing this thread

Back
Top Bottom