1,105,447 Community Members

VBA CODE in access 2007

Member Avatar
deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -11 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
1
 

hi,
im working on a small project on access 2007, i have a form that contains multiple textboxes ,and a save button. these textboxes are related to tables, so what i need is a code for that button to save the records in the textboxes in the tables and then show a msg box sayibg that the save processes is complete.
..
thank you very much....

Member Avatar
neket
Newbie Poster
4 posts since Feb 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi there,

Are you using Access VBA as your platform? or your just using access as your back-end and you have a form in VB6?

Member Avatar
neket
Newbie Poster
4 posts since Feb 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
1
 

Try this:

INSERT INTO TableName VALUES(Column1, Column2, Column_n)

you can visit http://www.functionx.com/vbaccess/records/sql/dataentry.htm for reference

Member Avatar
deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -11 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks very much for reply.
im using access 2007 forms, i created many tables with relations and created forms to with bound text boxes and button.
what im asking is i have a form have 5 text boxes and a button, the user should fill the data and press on the button which should save the records in the related tables.

Member Avatar
deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -11 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

here is my code:

Private Sub Command22_Click()
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Data is saved", vbOKOnly, "E-car System"
End Sub
the problem is when the save button is pressed the text boxes remain with same records that are filled, THEY ARE NOT BLANK, they should be blank when the records are saved. PLEASE HELP ME

Member Avatar
deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -11 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

DoCmd.GoToRecord , , AcRecord.acNewRec
this is what i was missing,, thanks anyway for your help the problem is solved

Question Answered as of 2 Years Ago by neket
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: