How to create new record

How can i use code to create a new record into a table.

Something like this?

CreateNewRecord("John","Smith")

I tried to Google it but i can't seem to find the answer.

help!
thanks


0
Tim
7/5/2007 12:34:03 AM
access 16762 articles. 3 followers. Follow

3 Replies
692 Views

Similar Articles

[PageSpeed] 30

On Wed, 4 Jul 2007 19:34:03 -0500, "Tim McGavin" <nws@gsw-inc.com> wrote:

>How can i use code to create a new record into a table.
>
>Something like this?
>
>CreateNewRecord("John","Smith")
>
>I tried to Google it but i can't seem to find the answer.
>
>help!
>thanks
>

Open a Recordset based on the table and use the AddNew method. See the online
help for OpenRecordset and AddNew in the VBA editor.

             John W. Vinson [MVP]
0
John
7/5/2007 1:09:45 AM
Tim McGavin wrote:
> How can i use code to create a new record into a table.
>
> Something like this?
>
> CreateNewRecord("John","Smith")
>
> I tried to Google it but i can't seem to find the answer.
>
> help!
> thanks

Is there something you don't like about forms? Or a reason they won't
work for you?

Look up DoCmd.RunSQL in the help.
Or CurrentDB.Execute strSQL (where strSQL is a valid SQL statement)
or you could use a recordset...

Where are you trying to insert the record from?

0
pietlinden
7/5/2007 1:15:42 AM
> Look up DoCmd.RunSQL in the help.
> Or CurrentDB.Execute strSQL (where strSQL is a valid SQL statement)
> or you could use a recordset...
>
> Where are you trying to insert the record from?
>

Thanks guys your comments helped so much!


0
Tim
7/5/2007 1:37:58 AM
Reply:

Similar Artilces:

OWA
SBS 2003 SP1, Exch 2003 SP2, FBA w/ SSL. If I add/delete a calendar event via OWA, I get a 5.1.7 NDR in my Inbox (pasted below). The calendar item is added/delete, and I see it in OWA or Outlook. I haven't seen any other posts similar to this, nothing on MS support. Any clues? ========== Your message did not reach some or all of the intended recipients. Subject: Sent: 12/21/2006 8:24 AM The following recipient(s) could not be reached: System Attendant on 12/21/2006 8:24 AM The e-mail address could not be found. Perhaps the recipient moved to a different e-mail organization, or t...

how do I increase drop list font and box size I created
Font is small and you have to scroll through list due to box size If the dropdown was created using Data Validation.............Font size is set at 8pt Dropdown box height cannot be changed. For workarounds like using a ComboBox and using Zoom see Debra Dalgleish's site on DV Lists. http://www.contextures.on.ca/tiptech.html Gord Dibben MS Excel MVP On Fri, 4 Apr 2008 11:36:02 -0700, cdietz1 <cdietz1@discussions.microsoft.com> wrote: >Font is small and you have to scroll through list due to box size ...

pre-select new record in combo box
Hi, I have a form (frmActivity) with a combo box (cboStore) that gets its data from a table (Store). If there is a new store which dose not show in the combo box I have a command button on the same form that open a popup window for entering the name of the new store. In the 'on close' event of the popup I requeary the combo box (cboStore) on the main form so that the new store will appear. What I would really like is to have the new store already selected in the combo box when the popup is closed. Is this possible and if so how? Thanks, Phil Try after the requery of the ...

Create MDI Child inside a thread?
I have attempted this through a CWinThread derived class but have been unable to get the window creation to work correctly. This is what I have so far: BOOL CSecurityFrameThread::InitInstance() { CRuntimeClass *pRT = RUNTIME_CLASS( CSecurityFrame ); CFrameWnd *pFrame = (CFrameWnd *)pRT->CreateObject(); CCreateContext ct; ct.m_pCurrentDoc = NULL; ct.m_pCurrentFrame = (CFrameWnd *)m_pParent; ct.m_pLastView = NULL; ct.m_pNewDocTemplate = NULL; BOOL bSuccess = pFrame->LoadFrame(IDR_TRUSSVIEWER, WS_VISIBLE | WS_OVERLAPPEDWINDOW | WS_CHILD...

Migrating notes records
Using Data Migration Manager I have uploaded 68000+ notes to CRM 4. However all notes show a creation date of 5/10/2008. Even more strangely, I have found that the AnnotationBase table contains the correct dates from the import file in the CreatedOn field, but has not set the OverriddenCreatedOn field. The server was built a few months ago, but certainly not in October 2008 - anyone have ideas as to how I can persuade CRM to recognise the values in CreatedOn? ...

how do I add in a dinamic graph the total as a new series?
I want to add, in a dinamic graphic, a new series: the mean. Is it possible? I need it to compare each series with the mean. Thanks in advance. Regards, Guillermo Fuenzalida The graph won't calculate the mean for you, so you'll need to calculate the mean as a new series in your data sheet, and then include that series as a new series in your graph. -- David Biddulph "Guillermo Fuenzalida" <Guillermo Fuenzalida@discussions.microsoft.com> wrote in message news:117FBACB-4DD2-41CC-864B-632666BE5CD5@microsoft.com... >I want to add, in a dinamic graphic, a new ser...

Add value when recording a macro
Hello, I recorded a macro to create a bar chart - I checked the checkbox to add the values. Stopped recording and showed me the chart with the values. If I run the macro again, it does not display the value. What is the code I need to always display the value? -- LizW After you create the chart, turn on the macro recorder again Select the chart, and choose Chart>Chart Options On the Data Labels tab, check Values Click OK Turn off the macro recorder In the recorded code, you'll see a line similar to this: ActiveChart.ApplyDataLabels AutoText:=True, LegendKey:=False, _ Ha...

Toolbox wizard to create Command Button
Access 2003 Windows XP Professional I used the Control Wizard on the Toolbox to create a Command Button to close the form. When I try to use it it will not run and returns this error message - The expression On Click you entered as the event property setting produced the following error: Expected: list separator or ). * The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]. * There may have been an error evaluating the function, event, or macro. Any ideas why? I'm at a loss. Check to see if you haven't changed the name ...

Creating an AD account don't make the mailbox in exch2K3
Hi, I don't understand what's happening. When I create a new account in AD, it no longer creates the mailboxes in exchange 2003. It was working a week ago... It asks me if I also want to create a mailbox, I answer YES and ... no mailbox. Please help me, I must create this mailbox quickly since a new employee arrived and my boss doesn't understand why the mail is not set yet. I believe that the mailbox is actually created only after the first message is sent to it or there is a first logon. So if you are looking for it and you do not see it, this may be the cause. Frank &qu...

Attachments to window notes vs record notes
Got an odd situation. On record notes we have the paperclip and can attach files with no problems. On window notes there is no paperclip. Never tried to attach a document to a window note before but always assumed that both record level and window level notes would act the same way. Has anyone else seen this? Should we be able to attach documents to window level notes? GP10, SP3. Thx. No - the behaviour you are seeing is by design. Window notes have never allowed for OLE attachments. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC h...

create price list from excel sheet
I have been using Excel 2003 to manage a list of approximately 200 items. This is a very simple list comprising of four or five fields one of which is the price. I prefer to use Excel to manage this data because it then becomes very simple for me to use formulas in order to calculate prices after changes or additions to the items. I would like to produce a simple A5 flyer listing all the items together with their prices. What will be the best way to do this? I have explored the possibility of exporting the Excel sheet into something like Microsoft publisher but I am looking for a fa...

create a report using vba to select the names for the report
Hi, I need to create a report of selected Customers, I have gone as far as creating a string with customer names in it. Whats next? sample = Selected_Customer_Names= [ABC], [test], [New], [A New One] ...... and so on. Is this correct for the report and/or how do i open the report with the above only listed? -- Message posted via http://www.accessmonster.com On Wed, 28 Apr 2010 03:47:34 GMT, "trevorC via AccessMonster.com" <u44860@uwe> wrote: >Hi, >I need to create a report of selected Customers, I have gone as far as >creating a string with ...

VS2003
Hello, I have a dialog resource and have created CDialog and a CFormView classes for this dialog. If I right-click a control in my dialog I can create a variable for the control, but how do I specify which class the variable belongs to, ie. my CDialog or CFormView class? I don't see how I can tell the add variable class wizard to which class the variable should be added. I'm converting a Dialog based app to a doc-view type app and am experimenting with CFormView, which is why I have CFormView and CDialog classes referencing the same dialog resource. Thanks for any help. -R...

rules created in Outlook 2003
I have a client who uses a lot of rules within Outlook 2003 to sort her mail. She is now getting this error when she attempts to create a new rule: "One or more rules could not be uplodaed to Exchange server and have been deactivated. This could be because some of the parameters are not supported or there is insufficient space to store all of your rules." Anyone have any ideas on how I can allow her to create more rules? Thanks. Hi, See this, e2k/e2k3 have the rules limit: http://support.microsoft.com/default.aspx?scid=kb;en-us;147298&Product=exch2k There"s...

Corrupt record in Money 2004
I have one record in my .mny file that I can't clear when I try to accept it after it has downloaded from my credit card site. I keep getting the message that the transaction cannot be entered and it remains outstanding - bolded. I tried the salvage processes - msmoney.exe -s and salv.exe. Neither worked. I just want to delete this one record and put it back manually. Is there a way to do this with jet database functionality? Not that is exposed to any of us users. The database is actually "msisam"--a buttoned up derivative of Jet. "Bill Boffi" <anonymo...

Outlook Synch error
I have one user and only one user have trouble going back online with the Outlook client. The user is connected to our VPN and then when the user clicks Go Online, it starts to synch then she gets the "the logged-on user does not have the appropriate security permissions to view the records or peform this specifc action" error/message. Outlook works fine and the user can use web CRM just fine. I've already tried changed the user's IE security settings to low, didn't help. Any ideas? James James, Could you provide a bit more information about the user, specifica...

Suddenly not able to save new or open previous files with name lengths over 45 characters
I'm using Excel 2003 if it matters ... I'm wondering if there is a known bug/issue on this. For what ever reason, when I try to save a new file (or for that matter open something done previously) with a name that has more than 45 characters or so (might be off by a couple), I get message that it can't save and then gives me a bunch of reasons (file path might not exist, might have too many characters, folder might be read only, etc). I know file exists in the folder I'm checking - I can email myself the file and open from the email so its definitely there! Any sane insight? ...

How to create new record
How can i use code to create a new record into a table. Something like this? CreateNewRecord("John","Smith") I tried to Google it but i can't seem to find the answer. help! thanks On Wed, 4 Jul 2007 19:34:03 -0500, "Tim McGavin" <nws@gsw-inc.com> wrote: >How can i use code to create a new record into a table. > >Something like this? > >CreateNewRecord("John","Smith") > >I tried to Google it but i can't seem to find the answer. > >help! >thanks > Open a Recordset based on the table and use ...

Moving .pst files to a new computer
When trying to import .pst files into the new computer the following error message comes up: \Outlook.pst is not compatible with this version of the Personal Folders information service. I am using Office 2003 What's up? What version of Outlook were you using on the original computer? "Paladin" <anonymous@discussions.microsoft.com> wrote in message news:057101c396c4$29533060$a101280a@phx.gbl... > When trying to import .pst files into the new computer > the following error message comes up: > > \Outlook.pst is not compatible with this version of the > P...

GP2010
What are the options for a Requisition Management solution for new GP BRL Adv Mgmt customers? It is my understanding that the Req Mgmt module has been taken off the GP BRL AM price list. Thanks, John ...

How to create a formula?
What do I do to have a result appear automatically in F68 which is the result of F67+C68+E68-D68. Currently I Copy and Paste on F67 & F68. In the cell type =F67+C68+E68-D68 best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Zygy" <zygy@bt.connect.com> wrote in message news:eDXC$INMHHA.5064@TK2MSFTNGP04.phx.gbl... > What do I do to have a result appear automatically in F68 which is the > result of F67+C68+E68-D68. Currently I Copy and Paste on F67 & F68. > As I said I copy and paste the formula already, but how do I...

RPC Error: creating mail in child domain from mmc User and computer.
Hello, I've an active directory on windows 2000, connected to several childs domains. In my father network i've an exchange 2003. Before i could create mail adress in my child domain from the mmc "user and computer" of my exchange server in my father domain. But now when i want to do " task exchange" on a user i get error : "RPC server is not avaiable, error id : c00706ba...." c00706ba". I don't know if this error is due to the exchange SP1, because i'didn't create new mail account for several month. Someone could help me. Forgive my ba...

Moving Money 2008 to new computer
I have Money Plus Deluxe 2008 on a computer. It is activated. I have the license key from Digital River. I do NOT have the original download and they won't let me redownload. I realize I'm a bad person for not saving a backup of that. I now want to upgrade from XP to Win7. Since there isn't a direct upgrade available I understand I'll need to reinstall apps. Typically not a big deal, but in this case, since I don't have installation bits this will be a problem. Am I really out of luck here? Is there any way to migrate/backup the existing Money (by copying the P...

Who Created Journal Entry
I am new to Great Plains. Is there a way to find out who created Journal Entries. I see the LASTUSER field in the GL20000. I'm not sure what this field actually represents and when it gets updated. Any resources that anybody could reccomend would be greatly appreciated. This won't help you for the past - but here's an idea for the future. All journal entries have source document of GJ. WE established source document codes as GJ-XX where XX would be each accountants initials. They are instructed to change the source document each time they make an entry. This is not a...

View equations created in Word 2007
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: intel Greetings! I've successfully installed Office 2008 update 12.0.1 on my MacBook Pro running 10.5.2. One of the fixes that was listed in the Microsoft Knowledgebase article associated with the update was the ability to edit equations created in Word 2007 for Windows. After applying the update, I still get a warning message when opening a file created in Word 2007: "This file contains Word 2007 for Windows equations"; the document opens with placeholders (blank squares) instead of the equations. Does anyone el...