473,770 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Append Query Not Working

171 New Member
Hi,
I have a simple append query which takes data from a form and appends it into a table.

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO tblSmsSent ( MobileNumber, ClientName, TimeSent, AppointmentTime, AppointmentDate )
  2. SELECT [Forms]![frmSMS]![tbMobile] AS Expr1, [Forms]![frmSMS]![tbFName] AS Expr2, Now() AS Expr3, [Forms]![frmSMS]![tbTime] AS Expr4, [Forms]![frmSMS]![tbDate] AS Expr5
  3. FROM tblSmsSent;
  4.  
The Table has the following fields
Field Type
ID Autonumber
Mobile Text (10 Charecters)
ClientName Text (50 Charecters) -This is only the first name
TimeSent Date/Time
AppointmentTime Date/Time
AppointmentDate Date/Time

Form Name: frmSms

Text Boxes in Form
tbMobile: Mobile # Won't run append query until the mobile number is 10 charecters
tbFName: First Name of Client
tbTime: Time of Appointment in hh:mm AMPM format
tbDate: Date of Appointment in dd/mm/yyyy format

Issue: Whenever I run the query it doesn't append anything to tblSmsSent which is the table which the data should be going to

Please Help, before I pull my hair out !
Jul 23 '09
16 10932
iheartvba
171 New Member
yes, to the best of my knowledge, but as you said, miracles don't happen when it comes to software, so I have definatley screwed up somewhere!

Thanks FishVal
Jul 29 '09 #11
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hmm, you are trying to insert fields FROM table tblSmsSent via the textboxes of a bound form INTO the self-same tblSmsSent?

Is that your intention?

Your SQL is referring to form textboxes, not fields in tblSmsSent. At most you would be appending one record to tblSmsSent - reflecting what is in the form you are really referring to - if you are not violating relational constraints by doing so.

If you could tell us what you need to insert, what table the fields come from, and why you are referring to form frmSms at present in your SELECT it would help us to understand what you are doing with this one.

-Stewart
Jul 30 '09 #12
iheartvba
171 New Member
Hi Stewart Ross Inverness,
My Intention is to insert data into a table (tblSms) from a form (frmSms), the data is coming from unbound text boxes in the form, and as I said before after I deleted the table and created the same table with the same properties again the append query started working.
Jul 30 '09 #13
Stewart Ross
2,545 Recognized Expert Moderator Specialist
I'm confused. You want to append unbound textbox data into tblSMS from a form which is bound to the same table? Why not simply bind the textboxes to appropriate fields from that table? You have not mentioned any reason why you are not already binding these textboxes, given that you are appending them to particular fields in the table (all of them from what you mention of the table design). Binding them would save you the hassle of recreating what Access already does - appending data from textboxes into a new record on your form using bound fields.

If you do not want to bind the textboxes regardless, there should be nothing to stop you appending unbound values from your form (although as I have said I am confused as to why you want to do so). I can see no logical reason why deleting and recreating the bound table should have made any difference.

You will not be able to append more than one record at a time this way given the single-value nature of the textboxes concerned when you run the append query even if you are successful in your current approach.

-Stewart
Aug 2 '09 #14
iheartvba
171 New Member
Hi Stewart Ross Inverness,
Quote1:
"You want to append unbound textbox data into tblSMS from a form which is bound to the same table"
Reply1: The form is not bound to any table
Quote2:
"You have not mentioned any reason why you are not already binding these textboxes"
Reply2: The reason I never bind a text box to a table is because I always have the data validated via VBA before it goes into the table. Also by using an append query I can getting a time stamp showing me when the entry was made and a current user stamp showing me which user made the entry, so to me the difference between binding a table to the form vs using unbound text boxes w/an append query is huge.
Quote3:
"You will not be able to append more than one record at a time this way"
Reply3: I only want to append 1 record at a time


Thank You
Aug 2 '09 #15
Stewart Ross
2,545 Recognized Expert Moderator Specialist
If all of that works for you then fine - but it can be done just as well with bound forms, using the Before Update event of the form to trigger data validation and record timestamping, with cancellation of the update if the validation fails.

Validation of individual fields can also be triggered from the After Update events of each field (bound or unbound).

Using unbound forms means replicating much of what Access already does - including populating each record onto the form in the first place. As mentioned, if it works for you then that's just fine - but you have a lot of items to maintain by taking this approach.

-Stewart
Aug 2 '09 #16
iheartvba
171 New Member
Thanks Stewart Ross Inverness,

For consistency I just prefer all the forms to be unbound. In some situations I may be appending more than 1 table, so if those can be catered by a bound table, then definatley I will try that next time.


Thank You
Aug 3 '09 #17

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

Similar topics

38
3542
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser = serial.Serial()
13
4229
by: Lee | last post by:
Hello All, First of all I would like to say thank you for all of the help I have received here. I have been teaching myself Access for about 4 years now and I've always been able to find a solution here - until now. This one is driving me crazy. I am making my first attempt at creating a runtime application. I am using Access 2003 Developer Extensions. Initially I developed the database without planning on creating a runtime app...
5
2254
by: solar | last post by:
I have copied a function that appends from table orders2 into table orders1 the row that has the value SubOrder = True in the table orders2. This function finds the highest ordered in the table orders2. But I want to find the highest ordered in the table orders2 instead. In short, I want to append the order from the table orders2 into the table orders1 and this order to get the next highest ordered.Somehow I canot manage it.Can you help...
2
2079
by: Deano | last post by:
Problem is that there are lots and lots of fields in an employee record. I specify a form control as the criterion for one of those fields which is the value of the primary key for that record. The idea is to copy the current record I am viewing in the form, to another table. I want to simple execute a stored query but I get a run-time error 3061, too few parameters. Expected 1. So even though I've specified the control within the...
27
4621
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res = $doc->loadHTMLFile("./aBasicSearchResult.html"); if ( $res == true ) { $zip = $doc->getElementById('zipRaw_id')->value; if ( 0 != $zip ) {
1
2362
by: James Hallam | last post by:
I have a form with a subform. When there are no entries in the subform, I have an append query which makes a default entry in the subform (for what I am doing there needs to be at least one value in the subform). The code in the form is this: Private Sub Form_AfterInsert() If Me.strWholeStr = 0 Then DoCmd.SetWarnings False
11
7897
by: kabradley | last post by:
Hello Everyone, So, thanks to nico's help I was finally able to 'finish' our companies access database. For the past week or so though,I have been designing forms that contain a subform and an option group so that whenever a certain button on the option group is pressed the correct subform source object property is changed to display the correct form. For instance, if they click "add new investment" the subform's source object is now changed to...
4
7606
by: franc sutherland | last post by:
Hello, I am using Access 2003. I am having trouble trapping the "can't append all the records in the append query" error message when appending data to a query from a table which is linked to an excel spreadsheet. There are two tables. One is a list of general contacts, and the other is a list of clubs. The clubs contain members who are within the contacts table. When I add a list of new club members from the
8
3175
jinalpatel
by: jinalpatel | last post by:
I have two tables. tblClass and tblWithdrawn. On my main form(bound to tblClass) I have several data entry fields like Date withdrawn, Status (active or withdrawn) Date Classified etc. Also there is one command button called cmdAppendDelete. On click this command button two queries are run .(append and delete) When user selects Status = Withdrawn and enter the "Date Withdrawn", he has to click on this command button. Append query...
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.