We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,106 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

VBA CODE in access 2007

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....

2
Contributors
5
Replies
1 Day
Discussion Span
2 Years Ago
Last Updated
6
Views
Question
Answered
deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -1
Solved Threads: 0
Skill Endorsements: 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?

neket
Newbie Poster
4 posts since Feb 2007
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

Try this:

INSERT INTO TableName VALUES(Column1, Column2, Column_n)

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

neket
Newbie Poster
4 posts since Feb 2007
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 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.

deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -1
Solved Threads: 0
Skill Endorsements: 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

deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -1
Solved Threads: 0
Skill Endorsements: 0

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

deadelgabar
Light Poster
31 posts since Apr 2010
Reputation Points: -1
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 2 Years Ago by neket

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0919 seconds using 2.67MB