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
1864 Views

Similar Articles

[PageSpeed] 0

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:

Add Invoice Number to Report
I have created a delivery table that contains all of the usual fields , Pickup, Delivery, Billing, NoPeices, Weight... etc. The table is updated with current delivery information daily. At the end of the week I create a report grouped on Billing customer that prints an invoice with all of the unprinted deliveries the customer is paying for... the report works fine. What I need to figure out is how to assign a unique invoice number (autonumber) to the report that will be associated with each Billing customer for that print period. Can I somehow generate a unique number at the time I ...

Printing data forms
I would like to be able to print Excel data forms. Is there a way? In some event of the form (a button, a click of the form itself, whatever): Me.PrintForm "Curious" <anonymous@discussions.microsoft.com> wrote in message news:170101c47bf9$f9191420$a301280a@phx.gbl... >I would like to be able to print Excel data forms. Is > there a way? If you mean the form you get when you do Data=>Form with the form displayed, do Alt+Print Screen. then drop the form and go to a new worksheet and do Edit=>Paste This will put an image of the form on the worksheet and yo...

Add SafePay footer record for date and account number
Union Bank of California has a Positive Pay format that requests a footer record for each day and account number. So if you transmit checks issued on two dates for a single account, the SafePay file would have two footer records--one for each date. Currently, I am only able to create a footer by account, totalling all checks issued for that account (regardless of date), and attributing that total to the Issue Date in the footer record. Union Bank reads the issue date on the footer, and sees that the checks issued on that date do not match the footer total, causing them to consider th...

How do I add vertical lines to separate columns in Outlook 2003 #2
In Outlook 2000, all columns were separated by a gray vertical line. I can't seem to set this up in Outlook 2003. Any help would be appreciated ARe you using Word as the message editor? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, mschwartz asked: | In Outlook 2000, all columns were separated by a gray | vertical line. I can't seem to set this up in O...

OnChange event
Hi all, I want to let the end users change the color of the top and bottom dark blue (or navy) borders of the Account form using a drop down that lists the colors (red, yellow and blue) .So the OnChange event of the picklist should trigger the change of the top and bottom dark blue colors to which ever color is selected. However I dont know if this can be accomplished. I even dont know if a stylesheet is used for that purpose, which one refers to these areas of the form. Any help will be deeply appreciated. Thanks in advance! ...

Outlook: Can't open JPEG files
I have Outlook 2000 an unable to open JPEG files. What setting has to be changed to open these files? ...

8192 rows limit when opening wk1 files ?
Hello, I am opening a .wk1 file, which contains around 60K rows, but only the first 8192 rows appear in Excel. Is there any way to have all the rows in the Excel file ? Thanks, Paul "paul" wrote... >I am opening a .wk1 file, which contains around 60K rows, >but only the first 8192 rows appear in Excel. > >Is there any way to have all the rows in the Excel file ? WK1 as in Lotus 1-2-3 Release 2.x native file format? Such .WK1 files support a single worksheet of 256 columns and 8,192 rows. PERIOD. Did you generate this '.WK1' file using a program other then...

GUID/Outlook format link giving error "Unable to open the seleted folder or item"
Hi, I have created custom forms in multiple public Outlook folders and when I send the GUID type link to the user, they receive an error: "Unable to open the seleted folder or item". The same happens if I send the Outlook type link. However, if I ask the user to go to the folder and find the appropriate posting, then the form opens and after that the link works, too. Is this due to some Exchange server setting? My clients are not the type that tolerate opening the form the long way, they want a one click solution. Please help, this is driving my team crazy. Any ideas are welcome...

how to open port in windows server 2003
hi , i have an exchange server 2003(sp1) with windows server 2003 (sp1) the scenarion is like that my mails are going out side through SMTP filter which is installed on another machine in this software the only port 25 is open, internaly my mails are working fine and i can also receive mails from another domain like hotmail and yahoo , but problem i am facing is that from out side of my network means if i want to check my mails from my home i am facing the problem is that i can send mail but can not receivce mail this happend because i am using smtp protocol for sending mails and pop3 ...

allow user to highlight field on form
I have a database which records info about disabled people. One form is used to input comments about the the person and has several memo fields. The user wants to be able to highlight a field if the information is important and needs to be highlighted to other users of the system. I cannot use conditional formatting because the decision to highlight the field is made by the user depending on different circumstances. Any help would be appreciated On Mon, 3 May 2010 16:52:01 -0700, aussiebob wrote: > I have a database which records info about disabled people. One form is used...

Form opens to blank record
I have a front page (a form) and my main database linked via a command button - it keeps opening on a particular record and I want it to open onto a blank record - how do I go about changing this? Thanks C (P.S. only a shakey understanding of code so if answer includes this - go easy on me and explain! Thanks) When you say: " I have a front page (a form) and my main database linked via a command button..." you are not talking about the use of Microsoft Office FrontPage, are you? http://www.amazon.com/Microsoft-FrontPage-2003-OLD-VERSION/dp/B0000AZJV8 I *thi...

Add phone number to quote report.
Hey guys, My retail staff asked me if it is possible to add the customer phone number to the Quote summary or Quote detailed report. Does anyone know what changes need to be made to the report to make this happen. I know I will have to change the query and add a join statement to get it from the customer record but am unable to figure out how to do it. Any ideas? Thanks, Nevermind, I figured it out myself. Thanks anyway. <nick@realkiteboarding.com> wrote in message news:BhKXd.15130$GO5.11570@fe07.lga... > Hey guys, > > My retail staff asked me if it is possible to a...

Return form and controls to default size
I have a pair of functions that resize a form and all of its controls at the click of a button. These are for one of my visually-impaired users who likes his buttons, boxes, and text to be larger. One button resizes all the controls up by a factor of 1.1, the other resizes them all down. I also want to put in a button to return everything to their default sizes. Could anyone please point me in the right direction to restore the default sizes for all controls, the "Detail", "Header", and "Footer" sections of a form? Thanks in advance. On Mon, 1...

Add mean and Standard Deviation to Histogram
Is there any way to add vertical lines of mean and Standard Deviation to a Histogram? >-----Original Message----- >Is there any way to add vertical lines of mean and Standard Deviation to a >Histogram? > Anna You can use Line_Column type of chart on the custom Chart Tab. This will allow you to add either the mean of the std dev. Show data as 23 39.5 34 39.5 45 39.5 56 39.5 where 39 is the average. You will have to add the other line yourself using the drawing toolbar. Remember to select the whole chart including the Added line and select Draw, Group on the drawing too...

Outlook 2003 won't open in ie but outlook express does
I just upgraded my harddrive form 120 gb to 400 gb using segates disk utility and when all was done eveything except system restore and the read email link from ie 7 worked fine. OL express would open and run ok but OL 2003 would not, no error just won't open. Doesnt' work in firefox either. Have uninstalled and reinstalled Office, no luck. Have unistalled ie7, no go either. Got system restore to work again by diabling the service from the managment console then starting it from the system restore tab in my computers/proporties. There seems to be some connection from ie to outlook...

Need to merge multiple records in to one.. Can it be done?
I have a table with thousands of records containing a clients name in one field, a date in a second field and then a note in a third field. A new record is created each time a note was entered for that client. Example: Client A 01/01/01 First Note Client A 01/05/01 Second Note Client A 02/10/01 Third Note Client B 01/01/01 First Note What I need to do is convert this information so each client only has one record and in that record are all of their notes and the dates for those notes. The data is going to be imported in a new program so it must be in the new format. Can someone ...

Opening in browser
I've seen the article on howto-outlook.com. The code is working fine, but is it possible to add to it so that it opens, prints page 1 then closes the browser? Basically I need something that will allow users to print the first page of an email via a macro. Thanks What article? What code? What version of Outlook? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Andy Smith" <AndySmith@discussions.microsoft.com> wrote in mess...

Content Boxes not appearing on list forms (newform.aspx)
Morning, FYI: I have posted this question on the sharepoint msdn forums and got directed to the SBS newsgroup, I asked this same question there and have been directed to here, i would be very greatfull if someone could please help. I have many workstations (95% now) now not displaying text boxes/content boxes within sharepoint (2003 SBS version). Any other site will display forms but not sharepoint. This does not seem to effect all machines and seems to have nothing to do with permissions as i have tried with all types of users. I have tried changing all the security settin...

Windows Media Player 10 Failure to Add Songs to Library Automatica
I'm running WMP10 and Windows XP. I've been using the Player for 4 years and this is the first time this issue has ever occurred. My laptop seemingly randomly froze recently, and I had not choice but to shut it down manually and restart it. After the restart, everything was back to normal except the WMP. It won't detect the songs in My Music folder as it has done for the last 4 years. If I go to the folder and play the song, it will work fine but it won't add the song to my WMP library, making a continuous playback of all my songs impossible and destroying the poi...

Can't open attachments in Outlook Express
I can't open attachments. I get the message; OE removed access to the following attachments iin your mail: ( the name of the attachment is shown. I sthis a virus thing. I have Norton Antivirus installed? Or is this a setting problem? I need some help ASAP as I have students who are depending on me for some answers Thank you very much Tim wrote: > I can't open attachments. I get the message; OE removed > access to the following attachments iin your mail: ( the > name of the attachment is shown. > > I sthis a virus thing. I have Norton Antivirus installed? > Or ...

name change of a form
Hi, I accidently named a form tblFormName instead of frmFormName. I want to change the name from tbl to frm to use the correct naming convention, so there isn't any confusion if the form is opened from the database window. I checked object dependencies and there are no objects that depend on the form, but there are objects on which the form depends. If I rename the form, will it cause any problems with other objects? (In laymen's terms: will it screw anything up if I change the form name?) Thanks. Can't possibly say. It depends on a lot of things. The Autocorrect feature ...

AA window should not have to open automatically if GL is linked.
When the user sets the Transaction Dimension Codes to "optional", the user may not want to deal with the AA pop windows if he/she decides not to record the transaction against the dimension code. -- Greg. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http...

Change Print Form
Anyone know how to change the format of the Case that prints out? Example, I'd liek to add my Compnay Logo to and a signature line so we can print the case prior to going to the client site and provide a copy of the Case for thier records as well as get sign off of the work being completed. As far as I know you have to use reports to customize prints. But if anyone knows how to change the standard printouts (for me for orders etc.)? Greetings, Wolfgang. "Jclark" wrote: > Anyone know how to change the format of the Case that prints out? Example, > I'd liek to...

Printing Part of User Form
Hi All On A User Form I have a Frame with 6 Text Boxes within the Frame - is it possible to just print the Frame and the Text Boxes within the Frame - and nothing else on the User Form. Any help much appreciated Cheers ------ Mully Hi Mully I don't think this is possible, at least not from VBA.......Have you thought of using a screenshot and then cropping it. Would that be suitable for your purposes? -- Emm100 ------------------------------------------------------------------------ Emm100's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=23236 View ...

VBA Editor Not Opening
I've got a workstation that will not open up the VBA editor in GP. I'm logged into the machine as Administrator and GP as 'sa.' Does anybody know what would prevent you from being able to open the VBA editor? I tried it in Office 2007 on the user's machine and was able to press <Alt-F11> to open the VBA editor. This is version 10.00.0903. -- Charles Allen, MVP Charles, Try to unregister then register the DEXVBA.DLL file using the REGSVR32.EXE program. You can find the DEXVBA.DLL file under your GP installation folder. Best regards, -- MG.- Mariano Gomez,...