Empty line inserted in database

I have a sales form, and a sales_lines form.

When I enter the details of a sale I can click on the "Add sales lines" button which opens the sales_lines form (the sale_ID is passed on to the sales_line form). In sales_lines form I can edit all the line items for that sale and then I perform a pretty straight forward insert SQL.

This is the only place where I have an Insert sql line (not very far in development.). I did not remove the alert for sql commands on my table so I get the popup saying "We will now append 1 row into sales_lines table". However after I create a sale with for example 3 sales_lines, and I get 3 popups each saying "we will append 1 row" I always end up with 4 lines in my sales_lines table. The first one is empty and then the 3 others are the ones I entered.

Does anybody know where that might come from?

Sponsored Links:

Related Topics

Combining Text Files using DOS
I am having some problems. Right now I have a code that combines files using FSO but for some reason it has been adding an empty line to the end of files and if the file has an empty line it combines that empty line.

The programs that run off these files cannot read this empty line correctly and blow up. I have asked programming to just fix this (very simple fix) but they are pretty dang stubborn over there.

I have looked at using the Shell cmd but I cant get it to work. Any suggestions? Btw right now I am appending all files in the specified folder, running through a loop, and combining them if they match certain criteria


Formatting Inserted PDF file in report
I am using Access (2000, don't laugh) to allow my staff to quickly enter data into a PDF form.

I've inserted the PDF file as an object, I can line up the fields to fit the representative boxes on the form.

My Problem. The inserted file does not match the size (8.5 X 11) of the original document and when I re-size it, it prints out disproportionately. (i.e., When I place up a form from my report behind a blank one printed directly from the file, and hold it up to the light, the text and images do not line up.

I have tried changing size mode to "zoom" and "stretch". It comes close, but not exactly. These forms will be scanned by the recipient and must line up as the originals


additional detail records to be inserted
I have a report that prints out as per the number of records into the detail section. however, I need to ensure that even if there fwere than 14 records, that the number of line items totals to 14.

in other words if 5 there are 5 records, there must 5 lines in the detail section with the relevent information and 9 empty lines.

Then if there are more than 14 records, a 2nd page must print out but in exactly the same way as the first ie: if there is 16 records, the first page must have 14 in the detail section, te2nd page must have 2 lines with the relevant records and 12 empty lines.


How to find the most recent inserted auto number is?
In one of the forms is a Parent / Child situation. The program inserts the parent then allows the children to be inserted or updated. The parent and children are related by an autonumber database table column called CustomerID. After a parent is inserted into the database I would like to find out what that autonumber ID is so I can use it for the child data.


Importing Table "DESIGN"
My company has a database that allows us to print report data based off information relating to 'aged care' facilities. each of our facilities has its own seperate access database.

there is also a control database, which is empty, that has the formatting of all the other databases. basically the plan is, as the facility databases adapt and change, I change the empty database aswell so that any new facility database I make will have these new changes.

my problem comes when I need to update all the OTHER facility databases. what I have been doing is importing reports, forms and queries from the empty database and all has been fine. HOWEVER, I have not had to update the design of a table until now. im sure you see the problem now, when I import a table from the empty database, naturally, it is empty, so it deletes all the current table data I have in database im updating.

So how do I import only the table design and not the empty data


Skip a line
When writing a SQL expression, is there a command to skip a line?

I have written a SQL expression that works fine. However, when the query comes up on my screen it is a long list and a little daunting. I would like a space or skipped line or empty row before it prints the next data.


Convert text to number in a union query
As it says on the tin!

The three individual queries are ok but some of the columns for one query are empty which I have inserted. Is it this causing the problem


Skip a line in SQL expression
When writing a SQL expression, is there a command to skip a line?

Am I asking this correctly?

I have written a SQL expression that works fine. However, when the query comes up on my screen it is a long list and a little daunting. I would like a space or skipped line or empty row before it prints the next data.

I am still not sure if I am asking this right.


imprting text from Excel
I have an Excel workbook that contains cells with a lot of text. The text contains line-breaks. These were inserted using Alt+Return. (Return on its own does not produce a line-break, but moves you to the next cell.)
When I import this table into Access, the line breaks are removed.
I have the same problem if I try just to link my Access table to the Excel workbo


2nd Line Of 2-line Text Field
I have an address database where the data entry form accepts two lines in the Street field. Queries only return the first line. How do I get to the second line in a query? How to interogate only the second line, when present?

Using Access 2002. Would rate myself an intermediate user


Error Handling for Report
In my proposal database I have six Calendar objects (positioned 3 across and 2 down) in one my reports. Three of the calendars should not appear in the reports if their data sources are null.

I have inserted the code below to display white boxes on top of the calendars when the data sources are empty. Yesterday the module crashed (probably a memory issue) and so I need error checking to handle this situation.


Initialize field with a blank
I am in the process of modifiying the MS Access sample database "Northwind" or use at a local not for profit orginzation. I have very limited MS Access skills.

The subset of code below is from the Form "Order Subform for order details". In the field "Quanity" below, I would like the code to write a blank field rather than a "0".

In other words, the line
Me![Quantity]=0, should be something like Me![Quantity]=blank

I have tried using "" , "empty" and a few others. I have also tried using default values of such as "". Any help will be appreciated.

Private Sub Product_ID_AfterUpdate()
'Initialize price and discount for each product change
If Not IsNull(Me![Product ID]) Then
Me![Quantity] = 0
Me.Quantity.Locked = False
Me![Unit Price] = GetWholesalePrice(Me![Product ID])
Me![Discount] = 0
Me![Status ID] = None_OrderItemStatus

'Empty Product records mean user wants to delete line item
Else
eh.TryToRunCommand acCmdDeleteRecord


Footer lines moving up
In this footer I need to place 3 lines with 2 fields each line, the problem is that when the line is empty (No data) I want the other lines under this one to go up,


Lookout wizard assistance required
In the attachment, there is a database containing a table, named Hardware, which has a small problem.
The fields named Type and MFR are set as scroll-downs by Lookout Wizard.
But, when I try to insert new data type, or a new MFR, it doesn't save the newly inserted data type, and it would be a burden to have to type it out over and over rather than just to scroll it down and click it.
Is there a way to set the fields up so that they save the new inserted data, while keeping the old ones already inserted


Format text in Acess memo field
My webpage stores data in an Access 2010 database in a memo field. The problem is, when I retrieve the data from the database, the text is posted in one line.

Ie:

I want the text to be displayed as follows:

Line 1
Line 2
Line 3

But it is displayed:

Line 1 Line 2 Line 3

As mentioned the access data type is "memo" and I have tried both normal and RTF-format.


How to auto update a textbox value when other textboxes + checkbox are not = null
I have a form with a couple of textboxes and a checkbox.

What I am trying to achieve is to update the content of a textbox called My textbox (there is a space in the name) automatically when some conditions are met

The first case: The value in My textbox should be set to Reviewed when 3 textboxes have values inserted (they are empty by default so when they are no longer empty My textbox should be updated automatically). The three textboxes are called txt_Verification, txt_Check and txt_final.

The second case: The value in My textbox should automatically be set to Ready for dispatch when the checkbox called Chk_Final_Approval is being checked (it is unchecked by default


Create LineNum by HdrNum in a conversion effort
I have a situation where I must convert data in an existing access database for use in a new database. The existing data has multiple line entries for the same header number, but has not identified each of those line entries with a line number.

I need to create a query that will automatically create the line number for each line entry, to restart at number 1 each time the header number changes


Breaking down a field
I have a database that contains a single address field with each line of the address entered onto a different line e.g.:
1 West Way
Southampton
Hampshire

What I need to do is to migratate this to a new database that has a field for each line eg:
Address1
Address2
Address3, etc.

I need to migrate about 4,000 records is there a way that this can be done programmatically


Appending data to the already imported data
I have an Access form through which I import the data from Excel spreadsheet (by assigning Docmd.transferspreadsheet to a Command Button). However, this should be the case when the database is empty.

The probelm: I have to transfer the data on a daily basis. So for the first time when the database is empty, I would directly import through the above method, but how to further append the data from the next day


6 key considerations when creating Access 2007 databases
In this article:
1. Creating a database from a template
2. Migrating a database from a previous version of Access
3. Importing information from other sources
4. Controlling the features available to database users
5. Assigning a password to a database
6. Securing a database for distribution
Creating the structure for a database is easy. But an empty database is no more useful than an empty document or worksheet. It is only when you fill, or populate, a database with data in tables that it starts to serve a purpose. As you add queries, forms, and reports, it becomes easier to use. If you customize it with a switchboard or custom categories and groups, it moves into the realm of being a database application. This article discusses six key things you should consider when creating a database application by using Microsoft Office Access 2007.