Open form to ID and add in the record if not there

Hello, I have an issue opening a form to an ID of the record I am currently 
on.  If I am on frmProjects and am adding a typing in a new EndUser from the 
dropdown in cboEndUser I want to be able to do two things:
1) Add this new EndUser name in the frmEndUserDetails in control source 
EndUserID (named cboEndUser) once I tab out of it
2) Have this new EndUser nae appear in the frmProjects once I finish adding 
details about this new End User in frmEndUser.  

So what happpens is that if I need to enter a new EndUser name in 
cboEndUser, once i tab out of cboEndUser the frmEndUserDetails opens to that 
new EndUser I just entered and is based on EndUserID. 

My EndUserID on tblProjects is a combobox with row source query 
SELECT tblEndUser.[EndUserID], [tblEndUser].[End User] FROM tblEndUser ORDER 
BY [tblEndUser].[End User]; 

It is kinda like add new record if not there and if it is there then go to 
it.  If it is there then I just double click the field cboEndUserID and it 
does go to the frmEndUser based on that id so I am good if it already exists. 
 Problem is getting it added if not exists.  

thank you...

0
Utf
6/6/2010 5:18:26 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
1961 Views

Similar Articles

[PageSpeed] 1

Velo wrote:
>Hello, I have an issue opening a form to an ID of the record I am currently 
>on.  If I am on frmProjects and am adding a typing in a new EndUser from the 
>dropdown in cboEndUser I want to be able to do two things:
>1) Add this new EndUser name in the frmEndUserDetails in control source 
>EndUserID (named cboEndUser) once I tab out of it
>2) Have this new EndUser nae appear in the frmProjects once I finish adding 
>details about this new End User in frmEndUser.  
>
>So what happpens is that if I need to enter a new EndUser name in 
>cboEndUser, once i tab out of cboEndUser the frmEndUserDetails opens to that 
>new EndUser I just entered and is based on EndUserID. 
>
>My EndUserID on tblProjects is a combobox with row source query 
>SELECT tblEndUser.[EndUserID], [tblEndUser].[End User] FROM tblEndUser ORDER 
>BY [tblEndUser].[End User]; 
>
>It is kinda like add new record if not there and if it is there then go to 
>it.  If it is there then I just double click the field cboEndUserID and it 
>does go to the frmEndUser based on that id so I am good if it already exists. 
> Problem is getting it added if not exists.  
>

The usual way to do that is to set the combo box's
LimitToList property to Yes.  Then add code to the combo
box's NotInList event procedure to open the end user form:

DoCmd.OpenForm "frmEndUserDetails", _
							DataMode:= acFormAdd, _
							WindowMode:=acDialog, _
							OpenArgs:= NewData
Response = acDataErrAdded

the Data<ode argument open the form with only a new, blank
record.  WindowMode tells access to suspend the code until
the new user form is closed or made invisible.  Setting
Response to acDataErrAdded tell the combo box to requery the
combo box's list to find the new user record that was just
added and then proceed normally.

To plug the new user into the new record, add a little code
to frmEndUserDetails' Load event procedure:

	If Not IsNull(Me.OpenArgs) Then
		Me.EndUserID = Me.OpenArgs
	End If

-- 
Marsh
MVP [MS Access]
0
Marshall
6/6/2010 5:42:59 PM
Reply:

Similar Artilces:

VB Procedure Onclick Button to open Report
I've been trying to write a bit of code that will print a particular report, if the form fiters are active, if not all records are displayed and i cant get it to work I've tried the following Private Sub CmdPrintList_Click() If Me.FilterOn = True ( <------------------------------That line is Giving me a GoTo Error) DoCmd.OpenReport "View All Projects", acViewPreview, , Me.Filter Else: Me.FilterOn = False DoCmd.OpenReport "View All Projects", acViewPreview End If End Sub Try this: Private Sub CmdPrintList_Click() If Me.FilterOn = True Then DoCmd.OpenReport...

outlook won't automatically receive/send when opened
outlook won't automatically receive/send when opened how do i get it to do this? An answer would require knowing your Outlook version, mail account type, and connection type. -- Russ Valentine [MVP-Outlook] "newbiejw" <newbiejw@discussions.microsoft.com> wrote in message news:EDBE10B5-2D8E-4684-99A8-C8C0F4FDC25F@microsoft.com... > outlook won't automatically receive/send when opened > how do i get it to do this? ...

Add Word and change format
1) Let say colomn A is a product codes, such as "PK0021", "UQ05P8", etc...Now I want add a "Z" in front the codes. To be "ZPK0021, ZUQ05P8". What's the faster way in case I got thousand of codes? 2) In my colomn B is such code as "18-521-65, 18-81-84, 18-1112-65" and etc. Now I would like to make it to be standard to 4 digit for the middle number to be "18-0521-65, 18-0081-84, 18-1112-65" ... As the same senario as above, I got more than thousand of such codes... What's the faster way? Kelvin The first could be done wi...

Excel Form "Component Not Registered"
I am using several excel spreadsheet that are working on many other machines but they all of a sudden started giving me a "component not registered" error. I don't know of any changes to my workstation environment. In order to debug, I stripped down the excel spreadsheet to the bare minimum. I noticed that when all the forms were removed from the spreadsheet that the problem disapeared. I removed everything in the spreadsheet except for one form and a Workbook_Open() procedure. No problem occurs if I have an empty procedure but as soon as I even put a comment in th...

Cannot open PDF in OWA
Users can't open PDF or other attachments when using OWA. Is this by design or am I missing something in administering our SBS 2003 server? Hi, Is this the errors you experience? http://support.microsoft.com/kb/812935/en-us Leif "jeckert" <jeckert@discussions.microsoft.com> wrote in message news:FBD8ED6D-233F-4F85-8048-B73427FE711E@microsoft.com... > Users can't open PDF or other attachments when using OWA. Is this by > design > or am I missing something in administering our SBS 2003 server? Leif, No error is given. IE reports that the page is done...

Users and Asset Data linked on Form
Hello everyone, I have two tables, one a Staff list and the other an Asset list extracted from seperate databases, the information in the tables has absolutely no common data, I have a form with the user name and other bits and pieces on from the staff list and also a drop down list of all asset numbers which I can then select the appropiate asset number from then, that asset number and other details I would like to be associated to that user. I have tried, I have done this in the past about 4 years ago but I cannot remember any of it! Any help would most appreciated Cheers David David, T...

Problem With Opening Attachments
For some reason, when I click on any attachment in received e-mails Microsoft Publisher opens and the attachments cannot be viewed. Does anybody know how to prevent this? It started just a couple of days ago and I haven't been able to find a solution anywhere. Thanks in advance. ...

Can I use VBA to add cells (over blanks) then do multiplication
I have a Word table in which the last column contains numbers (3 and 4) and some bank cells and I want it add them and put the total into the second last row (7 in this case). The last row contains a multiplier (3) which when applied to the total results in 21. Below is the table. | | | 3 | | | | | | | | 4 | | | | 7 | | | 3 |21| How can I achieve this in VBA (under Word 2003 and 2007) remembering that the user can add rows to the table and the last column can contain blank cells. Thanks in advance for any assistance, Peter Evans Sub ScratchMaco(...

Skip Records in a Form
I have a form in my database based on a table. The table is appended with new reocrds everyday. My goal is to have the form present only the new records and allow a user to key data into the new record and be recorded in the same table. The issue I have is that the form is displaying all records not just the new. Does anyone know a way to open a form and display only those records that have not been updated by the user? Thanks in advance Add a column for UpdateDate and update this column whenever a record is updated via the form. Set up a query to read all the rows/columns ...

How to add a host in safe sender list
Dear ALL, How can i config IMFv2 to unblock all emails sent from a specific host in my company? eg. all emails sent from 10.0.0.1 should not be blocked. Thanks a lot - Add it to the Connection Filtering - Global Accept list: Global Settings | Message Delivery properties | Connection Filtering | Accept. - Enable Connection Filtering in SMTP virtual server properties | General tab | Advanced | select IP(s) | Edit | Apply Connection Filter. -- Bharat Suneja MVP - Exchange www.zenprise.com NEW blog location: www.exchangepedia.com/blog ---------------------------------------------- "...

Is 2003 and open relay by default?
I have recently sent up an exchange 2003 server in our company. It was a fresh install on a 2003 server which is also a fresh install. Is 2003 Exchange an open relay by default? If so, how can I close it? no. by default it is closed to relaying "eotrue" <anonymous@discussions.microsoft.com> wrote in message news:0d5b01c3d949$36fe2090$a001280a@phx.gbl... > I have recently sent up an exchange 2003 server in our > company. It was a fresh install on a 2003 server which is > also a fresh install. > > Is 2003 Exchange an open relay by default? If so, how can &g...

VBA to add and remove text within cells
Hi, I have a field named "Postal" at the top of column F that always include a number with 5 digits then a city name then a region name, such as "11090 CARCASSONNE Linguadoca-Rossiglione". I need to create a program to have this field changed as following : "F-11090", then copying "CARCASSONNE" into the City field which is empty (column G). The city name is always starting just one space character after the postcode, same thing for the region name, it always starts one space character after the city name. The region has to be removed completely. ...

Excel sheet (OLE object) sometimes open on the form sometimes in E
Hello there, I have an Excel sheet (OLE object in the table) on a form , I have setup the Property in "Auto Activate" as Double-Click , so when I double click the object the sheet open. But sometime the object appears on the form as an Excel Icon - then when I double click it open in Excel - that is what I want. But sometime it appears as a table of data and when I double click it open on the form - I want to avoid that and instead always have the sheet open in excel. Any idea? Many many thanks, Dan Hi Dan, By default, you can directly double click the OLE Ob...

Forms Help
I have a form, the form has an ID that goes through many test/parameters. All the test/parameters associated with the ID remains on a sub form for viewing. I would like to develop a series (a-z) for each ID,were repeating information for the id is carried throughout all ID's and the one test paramter that differed, thus changing the Series Letter will be changed. Do you have any suggestions. Thanks LA -- Message posted via http://www.accessmonster.com On Wed, 22 Aug 2007 14:04:05 GMT, "misschanda via AccessMonster.com" <u36612@uwe> wrote: >I have a form, the for...

How to open saved .DBX files?
I saved a folder of e-mails to CD from Outlook Express shortly before my last computer died. I desperately need to open the folder (saved as a .dbx file) by tomorrow, to get my husband (in Portugal watching the footie) the details of his hotel!!I am now running Xp and have both outlook and outlook express(office 2003) I tried open with, but selecting OE takes you into the OE files rather than selecting it as a prog.If I try open with outlook, it just appears as a folder attachment in an e-mail Can anybody help me open this wretched thing??? Ask in an Outlook Express forum. This is an...

Adding Array Fields on forms
How to use Modifier to add an array fields of 3 elements on a form? thks in advance. Hi HFLO, Open modifier and select gp or 3rd party and then select exisiting modified form or select new form and then open window layout. From the Toolbox slect local fields in drop-down and press the new button and then enter field name and enter the array size for e.g. 3 and then select the datatype string or text and press OK button. Toolbox will show the newly created the array field, select that arrayfield and drag and dropped onto the layout 3 times. Hence ur array field would be there on ur for...

Opening page
How do I configure Outlook so that when it opens it displays immediately the weekly calendar? Thank you 'Tools|Options|Other|Advanced Options', set "Startup in this folder" to be "Calendar" Hal -- Hal Hostetler, CPBE -- hhh@kvoa.com Senior Engineer/MIS -- MS MVP-Print/Imaging -- WA7BGX http://www.kvoa.com -- "When News breaks, we fix it!" KVOA Television, Tucson, AZ. NBC Channel 4 Still Cadillacin' - www.badnewsbluesband.com "Jorge Bravo" <open@closed.com> wrote in message news:egO6toXKJHA.5904@TK2MSFTNGP02.phx.gbl... >...

Using the combo box from the forms toobar
When using the combo box from the forms toolbar I get text that is a specified size. I can increase the size of the drop down arrow and box but I can't change the text size. How do I change the text size? Hi R, > When using the combo box from the forms toolbar I get text that is a specified size. I can increase the size of the drop down arrow and box but I can't change the text size. How do I change the text size? You can't. The combo box from the forms toolbar is a fixed font. If you need a different font, you'll have to use the combobox from the control toolbox. Re...

how to create emails with sound when opening
how to create emails with sound when opening Buster <Buster@discussions.microsoft.com> wrote: > how to create emails with sound when opening http://www.howto-outlook.com/Howto/addingsound.htm -- Brian Tillman ...

On pre-printed paper(picture) how do I add script in white
I am trying to print white script on a pre-printed program. When sent to the printer the letters do not show. I have added fill to text box, but still letters do not print to sheets. I need help! If your printer does not have white ink, you can't. From what I've heard, printers that do have white ink are very expensive. -- JoAnn Paules Microsoft MVP - Publisher How to ask a question http://support.microsoft.com/kb/555375 "bearbiz" <bearbiz@discussions.microsoft.com> wrote in message news:8ECBB048-CD15-4DC8-A425-48287DEB7EB9@microsoft.com... >I am trying t...

Problem opening outlook
When I try to open outlook, a message box shows "unable to open your default mail folders. Could not start because a location to send and receive mail could not be found." Evidently I deleted something, but I don't know how or when. My CD installation disk is broken. Is there a way I can fix this problem without re-installing? Or a web site where I can download something? anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com> wrote: > When I try to open outlook, a message box shows "unable to > open your default mail folders. Could...

add pf To Other Calenders
This is a multi-part message in MIME format. ------=_NextPart_000_00B9_01C9724A.11E97A30 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit Hello, I try to add a public calendar ( in my case a Public Folder on my exchange server ) to Other Calendars in outlook: All my clients have outlook 2007 installed. On a few pc's, after i click on 'Add To Favoritesi' the Calendar is not added and i cannot see the calendar in 'Other Calendars' Any idea, how to solve this? Tx, I follow these instructi...

New blank document at opening
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel How do I DISABLE the new blank document that shows up when I open Word? It also seems to appear from time to time when I haven't instructed Word to do so ... <br><br>Help? <br><br>johnoerter That's a matter of how the program is designed & is in compliance with Apple's OS X guidelines for software of its type. There's literally nothing you can do in Word without having a file open. The new blank document is not an issue because it will evaporate as soon as you op...

Word documents are re-formatted to an undesired font on opening
I have saved documents with an Arial based style but on re-opening the styles have Times New Roman and different font sizes. How did you change the styles? -- Stefan Blom Microsoft Word MVP "KeithCC" <KeithCC@discussions.microsoft.com> wrote in message news:1C7387D1-C9F8-4E37-AF7F-7CD79CAC2042@microsoft.com... >I have saved documents with an Arial based style but on re-opening the >styles > have Times New Roman and different font sizes. ...

can't open VB editor in Excel 2007 under Vista
I have a spreadsheet with VB code in it. On my XP PC I can edit it without any problem. On my Vista PC, I can run the code, but if I try to edit it I get "error in loading dll". The VB window opens up, but the modules won't. Also, it used to work - I don't know why it stopped. Can anyone help? Thanks! On Nov 11, 3:42=A0am, "Sandy Rosenberg" <srosenb...@bloomfieldct.deleteme.org> wrote: > I have a spreadsheet with VB code in it. =A0On my XP PC I can edit it wit= hout > any problem. =A0On my Vista PC, I can run the code, but if I try to edit = it...