473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Add data in next row by using form in live

Hi all, I'm freshie in Microsoft Access (VB). Hope you guys can enlighten me.

I'm trying to develop database and facing few problem. When i want to add data by using form, the data will overwrite the old data in table.
In form have sub-form which i want it's live update but it's said "Syntax Error in Insert statement"
Below are the coding that i used.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdAdd_Click()
  2. Dim strSQL As String
  3.  
  4.    strSQL = "INSERT INTO Access_Fullsite (Site ID, Current Band) VALUES (" & Me!SiteID & ", '" & Current_Band & "');"
  5.    DoCmd.RunSQL strSQL
  6.    Access_FulSite_Subform.Form.Requery
  7.    Me.Requery
  8.  
  9. End Sub
  10.  
When i checked the table it's overwrite. Please help me.

Thanks in advanced,
Amira
Jan 27 '16 #1
1 911
Seth Schrock
2,965 Expert 2GB
If there are spaces in the field names (which I don't recommend) then you need square brackets around the name ([Site ID], [Current Band]).
Jan 27 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop"...
9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
0
by: Magic1812 | last post by:
Magic Software invites you to join us this coming Tuesday (January 27th, 2004) at 12:00 EDT / 17:00 GMT for a FREE live Webinar: Title: Data Integrity Using eDeveloper Date: January 27, 2004...
1
by: meganrobertson22 | last post by:
hi everybody- what is the best way to add data from one form to another? i have 2 tables: person and contract. here are some of the fields. table: person personid (autonumber and primary...
0
by: pd123 | last post by:
I'm new to C# and .net and I'm trying to create a form that will register users in a sql server database. I have the following code but when I run the code I get an error " The name 'Peter' is...
23
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
11
by: zaaba | last post by:
Hi all. I'm new here and also new in VB programming. Just need a little help from you all. My question is how VB can read data in calendar form. The coding that I create is like this. For Day = 1...
0
by: Rocke | last post by:
I'm (a newbie) having a problem dragging data from data sources onto the form. I have several SPROCs that select the same SQL file, but sort differently. No problem with all but the last one. I...
6
by: Elizabeth Mitte | last post by:
I have a database with multiple tables, all interlinked via referentially enforced relationships between pks and fks. I am attempting to produce forms which will allow the user to enter data that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.