New Record question 01-17-08

DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
    DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
    Application.Forms("Invoice Tracker New Entry").Caption = "CREATE INVOICE"
    DoCmd.GoToRecord , , acNewRec

When I use the above code. It creates a blank record in the datasheet. Is 
there a way to delete the record if it is blank and keep the record if there 
are data in it?
0
Utf
1/17/2008 2:03:00 AM
access 16762 articles. 3 followers. Follow

4 Replies
787 Views

Similar Articles

[PageSpeed] 40

There is always a new, empty record at the end of a datasheet unless you 
have set AllowNewRecords to False, or your query is not updateable.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Ayo" <Ayo@discussions.microsoft.com> wrote in message 
news:550D74F3-BC02-4210-BC0C-738C0FF5F5D0@microsoft.com...
> DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
>    DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
>    Application.Forms("Invoice Tracker New Entry").Caption = "CREATE 
> INVOICE"
>    DoCmd.GoToRecord , , acNewRec
>
> When I use the above code. It creates a blank record in the datasheet. Is
> there a way to delete the record if it is blank and keep the record if 
> there
> are data in it? 


0
Arvin
1/17/2008 3:18:04 AM
Thanks Arvin.
 So, how would I delete empty records from the database using code when the 
form closes. I would like to delete any blank records that are created in the 
datasheet when the form used to add records to the datasheet is closed.

"Arvin Meyer [MVP]" wrote:

> There is always a new, empty record at the end of a datasheet unless you 
> have set AllowNewRecords to False, or your query is not updateable.
> -- 
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
> 
> "Ayo" <Ayo@discussions.microsoft.com> wrote in message 
> news:550D74F3-BC02-4210-BC0C-738C0FF5F5D0@microsoft.com...
> > DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
> >    DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
> >    Application.Forms("Invoice Tracker New Entry").Caption = "CREATE 
> > INVOICE"
> >    DoCmd.GoToRecord , , acNewRec
> >
> > When I use the above code. It creates a blank record in the datasheet. Is
> > there a way to delete the record if it is blank and keep the record if 
> > there
> > are data in it? 
> 
> 
> 
0
Utf
1/17/2008 3:47:01 AM
The empty record I am talking about is a placeholder, not a real record.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Ayo" <Ayo@discussions.microsoft.com> wrote in message 
news:632F15FC-A5B5-45C6-A482-67E7CFD8F1C3@microsoft.com...
> Thanks Arvin.
> So, how would I delete empty records from the database using code when the
> form closes. I would like to delete any blank records that are created in 
> the
> datasheet when the form used to add records to the datasheet is closed.
>
> "Arvin Meyer [MVP]" wrote:
>
>> There is always a new, empty record at the end of a datasheet unless you
>> have set AllowNewRecords to False, or your query is not updateable.
>> -- 
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "Ayo" <Ayo@discussions.microsoft.com> wrote in message
>> news:550D74F3-BC02-4210-BC0C-738C0FF5F5D0@microsoft.com...
>> > DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
>> >    DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
>> >    Application.Forms("Invoice Tracker New Entry").Caption = "CREATE
>> > INVOICE"
>> >    DoCmd.GoToRecord , , acNewRec
>> >
>> > When I use the above code. It creates a blank record in the datasheet. 
>> > Is
>> > there a way to delete the record if it is blank and keep the record if
>> > there
>> > are data in it?
>>
>>
>> 


0
Arvin
1/17/2008 4:28:46 AM
Thanks Arvin. I found another post on here that kinda show me how to do what 
I needed to do, using DoCmd.RunCommand.

"Arvin Meyer [MVP]" wrote:

> The empty record I am talking about is a placeholder, not a real record.
> -- 
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
> 
> "Ayo" <Ayo@discussions.microsoft.com> wrote in message 
> news:632F15FC-A5B5-45C6-A482-67E7CFD8F1C3@microsoft.com...
> > Thanks Arvin.
> > So, how would I delete empty records from the database using code when the
> > form closes. I would like to delete any blank records that are created in 
> > the
> > datasheet when the form used to add records to the datasheet is closed.
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> There is always a new, empty record at the end of a datasheet unless you
> >> have set AllowNewRecords to False, or your query is not updateable.
> >> -- 
> >> Arvin Meyer, MCP, MVP
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >> "Ayo" <Ayo@discussions.microsoft.com> wrote in message
> >> news:550D74F3-BC02-4210-BC0C-738C0FF5F5D0@microsoft.com...
> >> > DoCmd.Close acForm, "Invoice Database Launch", acSaveYes
> >> >    DoCmd.OpenForm "Invoice Tracker New Entry", acNormal
> >> >    Application.Forms("Invoice Tracker New Entry").Caption = "CREATE
> >> > INVOICE"
> >> >    DoCmd.GoToRecord , , acNewRec
> >> >
> >> > When I use the above code. It creates a blank record in the datasheet. 
> >> > Is
> >> > there a way to delete the record if it is blank and keep the record if
> >> > there
> >> > are data in it?
> >>
> >>
> >> 
> 
> 
> 
0
Utf
1/17/2008 4:57:01 AM
Reply:

Similar Artilces:

Office XP Exel
Scenario: User's A,B, C, and D all have access to an excel XLS on a 2003 server. Users A & B have modify rights, users C&D only have read rights. If user A updates the file, the general tab in properties reflect the exact time the file was modified. After user A saves and closes the file, user D goes in. The changes are there, but in the properties general tab, the modify date in an old date (probably the actual creation date). Is this normal ? Any idea's ? ...

Thanks Ken Wright but one more question RE saving data from circular references
Thanks heaps for that macro Ken Wright . I have run it and it works. However it loops forever. Can I set it up so that it could save dat from a certain number of iterations? Thanks again Michae -- Message posted from http://www.ExcelForum.com Hi Michael, If you stayed within your thread and did not change the subject Ken would see your reply as a reply to his reply and would see it a lot faster than when you start a new thread. Ken would probably see your post highlighted in RED. Also someone other than Ken might have been able to help you. (not me I avoid anything that hints of circul...

Help with PTR Records
I'm confused as to how to have our ISP setup a PTR record for our Exchange 2000 server. Does the PTR record have to be the exact same name as the computer name of our Exchange server? For example, if our Exchange server's computer name is "exchange", making the FQDN exchange.domain.com, does the PTR record need to be "exchange.domain.com"? Now, assuming that I put an anti-virus/spam filtering appliance in front of our Exchange server, so that all outgoing e-mail goes through the appliance, does the PTR record need to be the name of the Exchange server or the ...

Enter "1", cell show ".01". Why?
Any number typed into a cell is divided by 100. If proceded by "=" the number is correct. What caused this and how can I fix it? Try this .. Click Tools > Options > Edit tab Uncheck "Fixed decimal" > OK Things should be back to normal now .. (it's a fixed decimal setting !) -- Rgds Max xl 97 --- Singapore, GMT+8 xdemechanik http://savefile.com/projects/236895 -- "Yonian" <Yonian@discussions.microsoft.com> wrote in message news:40499CA4-7FAF-42A6-8B19-A90881735C50@microsoft.com... > Any number typed into a cell is divided by 100. > If p...

New message opens up behind outlook window
Everytime I click new in my inbox to open a new message, the new message pops up behind the main oulook window. does anyone know how to make this stop? ...

New to Mail Merge
So I am checking to see if I can merge a list of names(roughly 450) into a template in Publisher that will be used a name plate of sorts. I also want to include years of services in the template, i.e. John Smith 12 years of service. Is this possible and what is the easiest route? Yes it is very possible in Publisher. There is a lot of help here: http://office.microsoft.com/en-us/publisher/CH100502901033.aspx If you decide to use Publisher there is a registry fix that will be beneficial. http://ed.mvps.org/Static.aspx?=Publisher/registryfix -- Mary Sauer http://msauer.mvp...

Newbie question
'hello, can someone explain in plain English what this formula is actually saying: =IF(C32="FOB",(B28:C28/'Board Pricing and conversion'!B19)-B28,(B28/'Board Pricing and conversion'!B20)-B28) I understand the C32="FOB", but the rest I don't. I know it is referencing another spreadsheet but don't know what it is looking at?? Thanks bassman Double-click on the cell with the formula and you will see the syntax IF(logical_test, [value_if_true], [value_if_false]) You have a logical text for "FOB" on C32 of active sheet. If True the...

O2003 New Toolbars Saved Where?
I have XP with O2003 on one computer. Just got a new computer with W7 and installed O2003. I copied over the "outcmd.dat" file and I can see my data (e.g. views) so I know its using the correct "outcmd.dat" file. However two custom toolbars I created are not shown nor are they in the customized toolbar list. Are custom toolbars saved in a different location? Thanks Shawn On Jul 24, 6:22=A0pm, srm <s...@primatech.com> wrote: > I have XP with O2003 on one computer. Just got a new computer with W7 > and installed O2003. I copied over the "outcmd.dat" ...

Email Router 05-17-04
Hello, I want to create a queue for support. This queue should receive internal emails from other departments that they are requesting support. Can anybody tell us how to rout these emails to the CRM Queue? Regards, Khalid Hello This is a limitation of MS CRM. The router does not intercept internal email. Only emails that reach the mailserver trough the SMTP gateway are processed. Regards Cedric "Khalid" <anonymous@discussions.microsoft.com> wrote in message news:e08101c43c13$bb1dbcf0$a001280a@phx.gbl... > Hello, > I want to create a queue for support. This ...

A first look at the new Office Snapin for MSCRM
http://blogs.msdn.com/jstraumann -- John [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script or code samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm. ...

Why is Excel changing the last 2 digits of a 17 digit num to 00.
When I enter a 17 digit number in a cell in Excel, the last 2 digits turn to 00 when I leave the cell. Format - Cell does not have a setting to stop this 'feature'. How do I make Excel recongize the large number? On Thu, 28 Jul 2005 19:09:01 -0700, "Allie" <Allie@discussions.microsoft.com> wrote: >When I enter a 17 digit number in a cell in Excel, the last 2 digits turn to >00 when I leave the cell. Format - Cell does not have a setting to stop this >'feature'. Excel Specifications and Limits: Calculation specifications Feature Maximu...

How to add new entity?
Hi. I'm now researching the customization abilities of MS CRM 1.2. So I have a small task, which I'm not able to accomplish with SDK. The main question is how to add additional entity to CRM? I need to add entity "Pets", and dictionary "PetTypes". Pets should be linked with Contacts (1:M). Pets should have 3 attributes: - Name (string of 150 chars), - Type (value from PetTypes dictionary), - Description (string of 1000 chars) PetTypes should have 3 entries: "Cat", "Dog" and "Parrot" I expect that i...

Error creating new task
Error .. "Could not complete operation. One or more parameter values are not vaild" ...

Setting Outlook settings to new server
We are in the process of moving mailboxes to a new server. Is there a utility or ad policy to automatically configure outlook to point to the new exchange server? Instead of manually configuring the users outlook profile. On Tue, 21 Nov 2006 11:15:01 -0800, Rich <Rich@discussions.microsoft.com> wrote: >We are in the process of moving mailboxes to a new server. Is there a utility >or ad policy to automatically configure outlook to point to the new exchange >server? Instead of manually configuring the users outlook profile. If you are moving the mailboxes in the same org vi...

Email accounts are not created for new user
I had a severe system crash several days ago because of bad memory in my domain controller (Server 2003 R2)/Exchange server 2003 (small site - no extra systems). I had to reinstall Exchange 2003 and reload the exchange store from backup. For existing users everything works great. Everybody can send and receive email, the calender works correctly, etc. OWA works. However, when I create a new user account in Active Directory Computers and Users, the account is created and the new user can log onto a system. However, Outlook 2003 cannot be configured to use the exchange server. In t...

How to write a new entry in a combo box to its underlying table
Dear Access 2007 VBA Gurus, I have a assets database (rather uncreatively named "Assets"). I use a form (named "Asset Acquisition Input Form New") to enter new assets. The "Manufacturer" field (combo box name "Manufacturers_ID) on this form is a lookup to a Manufacturers table. What I want to happen is when I enter an item that is not in the lookup list, I want a message box to prompt me to add the new entry to the underlying table, or to cancel and select an item from the list. I have no trouble with the MsgBox command itself. What I don&...

exchange 5.5 will not keep new server name.
We have exchange 5.5 in enviroment where windows server 2003 is setup along with active directory and active direcitory intergrated zone which is replicated to other servers. Problem: I enter the Exchange Server Name followed by the mailbox name then I select the button [CHECK NAME] In the exchange server name field after entering the new exchange server name the old exchange server name is displayed instead. This only happens in office 2003 professional and not in office 2000 professional "old exchange server name" How did you go about changing the name of the server...

New Static IP
SBS2003R2 We'll be moving our office this coming weekend. We will be getting a new static IP from our ISP (I tried to get them to let us keep our existing one but they said that would take "an act of God"). Our mail is delivered to our server after being filtered for spam by McAfee. Our server is configured to only allow mail from McAfee's range of IP address and an internal IP for a "scan to email" device. In an effort to make this move as smooth as possible I'll be calling McAfee in advance of this move and setting up a "ticket number"...

Cannot create mailbox for new user accounts
I am running Exchange 2003 on Server 2003. I was able to move all existing mailboxes from my old Exchange 2000 server to my new 2003 server. Whenever I try to create a new user it creates the user normally and asks if I want to create a mailbox for the user. I check yes, and it says account created successfully. However, the mailbox never appears in Exchange, no email address is assigned to the new user, and I cannot send mail to the user account either. If I try to access any Exchange properties from ADUC it shows everyhting as if a mailbox exists, but there is no mailbox. I am ...

How to copy aQuery to a new Table?
I have a database in a Table, a report based on that same Table and a Query based on that Report. After two months or so I like, after some new data input, to save the Table into a new Object Table. What is the best way for the Report and Query to follow the new Table whitout recreating the original Report & Query? Thankyou for your comments. I use MS Office Access 2007. Joe T >>I have a database in a Table, a report based on that same Table and a Query based on that Report. Your phrasing is wrong when it comes to the elements of an Access database. A dat...

Test #17
...

Mailbox permissions #17
I have a bit of a mess with a mailbox that receives all messages that clients send through our web site. Everyone except one person has this additional mailbox open within Oulook. The remaining person I can't seem to get the permissions down. I myself have it added on my desktop. The only reason I think I can expand the mailbox is because I'm in the enterprise admin, domain admin, and exchange admin groups. When I look at the properties of the mailbox, my account has "None" as so does this other employee. When I click on my account, the employee's account wo/ ...

"could not fetch new headers " ERROR
i get the error " could not fetch new headers in the inbox of IMA server.The operation was cancelled ", while using my outlook 2000 o win98se mach. config: smtp/imap thro internet mail a/c option pl try to provide solutions to it. the error message pops up say every 5 min whenever outlook is on. thnks n regards gir ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com aggiridharan <aggiridharan.149yy0@outlookforum.com> wrote: > i get the error " coul...

Middle mouse button does not always open in new tab anymore
Hi! I am experiencing the problem that when I click with the middle mouse button on a link (for example google search results) it does not always open it in a new tab anymore. In about 20% of the cases it takes over the current tab instead. The same problem is explained here in german: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.de.internetexplorer&tid=cd463718-8df6-4ee4-9e8a-9ee527837f83&cat=&lang=de&cr=DE&sloc=&p=1 But since there was no answer found so far I decided to take it to the next level (english c...

Scheduling formula question
I know both are the same equation. Which one is by definition ? "Duration = Work / Units" or "Work = Duration x Units". I have a three day task with a resource assigned (Max. Units 100%, Units:100%). All calendars are the default Standard base calendar; Hours per day is 9 hours. How do we build the equation to calculate 27 hours of work ? TBol -- To be technically correct, the Duration Equation formula is written as: Duration = Work/(Hours Per Day x Units) You find the Hours Per Day value on the Calendar page of the Options dialog, accessed by clic...