|
|
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
|
|
|
|
Reply
|
Utf
|
6/6/2010 5:18:26 PM |
|
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
|
|
|
|
Reply
|
Marshall
|
6/6/2010 5:42:59 PM
|
|
|
1 Replies
619 Views
(page loaded in 0.164 seconds)
Similiar Articles: Open form to ID and add in the record if not there - microsoft ...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... Open Form based on Current record without unique ID/Key ...All, I was wondering if there was a way to open a form based only on the current record in focus... ... so I was able to use that without having to add a unique id ... microsoft.public.access.formscodingOpen form to ID and add in the record if not there Utf 1 370 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 ... Open form and if no matching records create a new record ...... the wizard to open records with Patient_ID. > > Private Sub Medical_Form ... the DCount if there is a record to open up the form ... Need VBA help to open form/add new record ... How do i set open form to current record? - microsoft.public ...... form yet i need to add more fields but i do not want the form to ... textbox holding the ID value. >> Remember, when you open another form to the exact same record there ... Can't add new record to form - microsoft.public.access.forms ...In other words for every record in your main table there may be a ... I can still open the table and add > a new record, but not using the form. > > So, I actually have ... Open form for add/edit records - microsoft.public.access.forms ...-- There's ALWAYS more than one way to skin a ... for adding a new record - microsoft ... open continuous form - shows 1st record not last.. - microsoft ... Open form for add ... Command to run access, open to specific form and specific record ...... the form. I presume I can add ... open the new form, there are ... open form to specific record ... I need a command button next to my combobox that contains Cust_ID to open ... open a Report to a specific record - microsoft.public.access ...... made the report there is the staffID on both the report and form for the link i want to add a ... space in Employee ID (not ... Open form to specific record from button on ... Open form to specific record from button on continuous form ...... If there could be an apostrophe in [id]: DoCmd ... microsoft ..... id ... Open form to specific record ... clicking on a record in a table - microsoft ... Open form for add ... Open form to ID and add in the record if not there - microsoft ...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... Command button to open a form on a specific record, based on the ...Command button to open a form on a specific record ... In this new form there is a ... button and find the record at once, and not have to put manually the ID in the new form. open form to specific record or create new record - Microsoft ...open form to specific record or create new record. ... through the student ID ... have them and a blank record where there is no record available. If you try to open another form ... Access 2007 Command Button to open Form based on Current Record ...And if there is no record in the ... that if it is null to add new. In 2007, the option that is not the default for the command button is "open the form and ... Open Forms, Views, and Dialogs with a URLTo open a new account entity record form for on ... want to add a custom button to the ribbon for a specific entity using the id value for current record ... account record id ... 7/24/2012 5:01:37 PM
|
|
|
|
|
|
|
|
|