Difficulties on my form. Help please!!!!

Keidy

Registered User.
Local time
Today, 16:36
Joined
Dec 5, 2006
Messages
26
Hi! I have a problem with my form [EDITAR], the problem is that i did a form basing me on a table, but now i want to create a command that when i press it, it has to let me edit my data. i don't know how to explain me very well. i want to change my data but changing it with my form and save that information.

the other problem is that i want to create the same form for but only to add new data on the same table, i want to create a command that i will press if i want to add new records.... help i really need help:confused:
 
lock down

Sounds like you should look at the allow additions and editing properties of your form.
 
The default action of a form is to allow editing of the data. So, unless you've changed the 'Allow Edits' parameter, you should have no problem editing the record.
If you have changed the form and disallowed edits, you can add a button that will allow edits. Here's how:
1. Add a button to the form.
2. Cancel the wizard that pops up.
3. Right-click on the new button, and select 'Build Event'
4. Select 'Code Builder' from the popup list
5. Insert the following code:
Code:
Me.AllowEdits = True
That's it!
Keep in mind, that will allow edits to the records for the entire user session, until they close and re-open the form. So, if they finish editing that record and move to a new record, they will still be allowed to edit records.
To get around this, disable edits via the 'OnCurrent' event of the form:
1. Get to the form properties by right-clicking on the blank, dark-grey section around your form and selecting 'properties'.
2. On the Events tab, select the 'On Current' event, and hit the '...' button to the right of it.
3. Add this code:
Code:
Me.AllowEdits = False

As for the 'Add New Record' button, the built-in wizard should walk you through it. Add a new record, and use the wizard to build it.

NOTE: If wizards aren't working for you, make sure they are turned on by confirming the 'Magic Wand' is highlighted in the Toolbox Toolbar (second button in, right after the pointer icon).
 
thanks a lot Jon. About the wizard i don't have the wizard, it's not installed here where i work, what can i do about the add button.. :D
 
If the wizards aren't installed, you will have to add them using the Add/Remove Programs, and changing the settings for Microsoft Access.

They should appear as the circled icon in the picture attached.
 

Attachments

  • accesswizard.jpg
    accesswizard.jpg
    25.3 KB · Views: 102
Jon, on my work that button doesn't work because it's not installed, :( do you know how to do it in VB? because here at my work there is a program that doesn't allow me using the wizard or install it
 
Sure!
The code is quite simple:
Code:
    DoCmd.GoToRecord , , acNewRec
OR
Code:
    DoCmd.RunCommand acCmdRecordsGoToNew
 
thanks a lot, i will use it as soon as possible...
 

Users who are viewing this thread

Back
Top Bottom