Forms :: Pass Value From Form To Calling Form
Apr 21, 2015
I have Form A that is bound to tbl_Member (MemberId, LastName, FirstName, and some other fields).
On Form A is a combobox [cbo_Selector]. The combobox shows LastName and FirstName from tbl_Member, but when a name is selected, it returns the member's ID to Form A and causes that member's record to show in Form A (along with other data pertinent to the member). This works fine until I type a name into the combobox that does not exist in the underlying table.
I use the NotInList event of the combobox to pop up another form (Form B) in the DataEntry mode. Form B is bound to the same table as Form A. I enter the LastName, FirstName, and exit Form B. What I am trying to do is to have Form B pass back the new MemberId to Form A and specifically to add that record's data to the combobox on Form A.
I have tried several things to accomplish this. When Form B updates, the table has the new member added, but when I try to requery Form A or the combobox, I get errors. how do I communicate to the combobox in Form A the information from the newly added record?
View Replies
ADVERTISEMENT
Jul 15, 2013
i have a form with a sub form and combobox, when i select item i want that the sub form will be update with new values according to parameters from the combox.
the data of the sub form is from query with criteria
Code:
[Forms]![Examination]![Client_ID]
and the combobox (Client_ID) "After Update" event set to macro- requery (the sub form)
so every time that item selected in the parent form combobox the sub form items /data will change.
*i attached a screenshot
View 3 Replies
View Related
Jun 29, 2005
I this is a simplifed version a saved query called "qryTest"
PARAMETERS [gUserID] Long;
SELECT [Id],'Complaint' AS IncidentType FROM tblComplaints WHERE tblComplaints.[Id] IN (Select Incident_ID from tblNotification where Dept_ID IN (Select Dept_ID from tblUserDepts Where User_Id = [gUserID] ) AND Incident_Type = 'Complaint');
UNION ALL SELECT [Id],'Fall' AS IncidentType, FROM tblFalls tblFalls.[Id] IN (Select Incident_ID from tblNotification where Dept_ID IN (Select Dept_ID from tblUserDepts Where User_Id = [gUserID] ) AND Incident_Type = 'Fall');
how to i call the result from code or from the query manager and include the parameter so there is no prompt that comes up?
like
Me.ListNew.RowSource = "qryTest " & gUserID &";"
or
Select * from qryTest , 31 - where 31 is the value fed to the parameter
??? does anyone know? I know it can be called in APS like this:
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strConn ' strconn is my connection string
set rsP=createobject("adodb.recordset")
conn.qryTest 31
.....
I can't believe I can't do it from the query string!
Heeeellpppp!
View 3 Replies
View Related
May 22, 2006
Hi All
I have a form based on a table called tblListMaster and I want to allow users to open up another form showing all the members of one of the entries in that table so I have added a button called 'Show List Members'.
The list members form which I then want to bring up is also based on tblListMembers (it's a master-detail form). When I hit the button to open up the list members form I get an error message saying that the table is already opened exclusively.
I can understand why I get that message so I thought I would be cunning and create a dummy form which I open up, passing in my list id in the openargs (at that point I also close the original form) and then from that dummy form automatically open up the master detail form and close the dummy.
Code in List Master form
Private Sub cmdListMembers_Click()
' open up the list members form
DoCmd.OpenForm "frmDummy", acNormal, , , , , Me.ListId
DoCmd.Close
End Sub
Code in Form Load of dummy form
Private Sub Form_Load()
DoCmd.OpenForm "frmMaintainListMembers", acNormal, , , , acWindowNormal, Me.OpenArgs
DoCmd.Close
End Sub
Sadly I still get the same error message - does any one have any ideas what I'm doing wrong?
Gordon
View 4 Replies
View Related
Jan 12, 2015
In Access 2013 I have 2 tables
tbAssembleias
tbEntities
The tbEntities, have a fiel called tbPresent (yes/no) to register the presents in a condominium meeting.
Table Name: tbEntities
Fields:
tbEntId...tbPresent (yes / no)..........tbVotes 1.........ye...........................5
2.........no...........................3
3.........yes..........................4
4.........no...........................6
In the form is the table tbAssembleias, but I want to put from the other table which is not present in the form:
1. a control that count how many are present (= yes)Ex: Appearances 22. a control that sum the votes of those presentEx: Votes 9I already have a query that count how many are in the meeting, but cant realize how to pass the information to the field in the form..This is the SQL view of the query with the real field names - and working:
SELECT Count(tbEntidades.tbAssPresente) AS ContaPresentes, tbEntidades.tbAssPresente
FROM tbEntidades
GROUP BY tbEntidades.tbAssPresente
HAVING (((Count(tbEntidades.tbAssPresente))=True) AND ((tbEntidades.tbAssPresente)=True));
View 1 Replies
View Related
Jun 21, 2013
I have modal form - frmZlecenia
I would like to copy one control, then close this form, open concrete form and pass value to control.
My code is
Private Sub Menu_Click()
DoCmd.OpenForm "frmZleceniaMarzenaNawigacjaPD"
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie = Me.Imie
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie.SetFocus
DoCmd.Close acForm, Me.name
End Sub
The problem is, still opens the previous form, not form "frmZlecenia"
e.g If I open form x then from this form I open my modal form "frmZlecenia" and then I will click "menu" button - now form "x" is open :/, but should be "frmZleceniaMarzenaNawigacjaPD"
There is some way to open concrete form from modal form?
View 1 Replies
View Related
Oct 4, 2005
I need help...
ok, what i have is a table with all the fields, comp_id, Yr,Values
i need to put 2 combo boxes coz the user needs to choose bet. 2 years and get the difference of the value within each yr. I got this part already but my problem is, i need to do a report and what i need to do is everytime the user chooses 2 yrs. the report should come up showing the difference of 2 yrs and the comp_id and type under each yr plus the difference of there values.
*note i already did the whole report including yr, comp_id,data_type*
Im just having a problem in the form structure..
am i exmplaing this clearly?
Pls help..thanks
View 1 Replies
View Related
Jun 7, 2012
I have created a module with a function that capitalizes the third letter in words that begin with "Mc". I have a table with the city field all uppercase letters. I created an update query that takes the field and correctly changes it. How you would go about tying this function to the textbox on the input form. So, if a user incorrectly enters "mccoy" in the City Field the function would be called and would automatically change it to "McCoy".
View 2 Replies
View Related
Jul 27, 2005
How do you use a button on a form to call another access program? We have 8 access programs that we want to be able to call from one form.
Thanks
View 2 Replies
View Related
Mar 21, 2006
Hi. I have spent ages searching, but I can't find anything relating specifically to what I want to do, and I'm simply not experienced enough to make up the code as I go along.
I want to call a value from a field in TableA to a textbox on a form bound to TableB. I know, its probably simple, but I can't figure it out.
Any help would be greatly appreciated.
View 13 Replies
View Related
Sep 27, 2006
I have a main form with a subform. I need to update values in the subform when a field on the main form is updated using afterupdate on that control.
Example:
main form name: mainform
control name: gst (on main form)
subform name: subform
records displayed as datasheet.
records field to update: retail
In main form gst control afterupdate event:
Me.[subform].[Form].retail_afterUpdate
Hoping to call the afterUpdate procedure on the retail field.
Error message:
Method or data member not found.
View 2 Replies
View Related
Apr 20, 2015
I want to call the "On Current" event of another form.
I have a parent(mainform) form and then I have a subform(CurrentForm) and in that subform(CurrentForm) I have another subform(mysubtab01). From the mySubTab01, I want to call the On Current of the parent form. How can i do this?
This is an example of how I am setting the record source of the deepest subform where I want to call the parent on current from:
Forms(mainform)(CurrentForm)(mySubTab01).Form.Reco rdSource = "Select * from subQrytab03"
View 12 Replies
View Related
Jun 24, 2014
I am using an on-click event on my form to call up a report for the current record. It has been a while since I've used the form to call the report, but I always remember it working correctly. Today when I try to call up the report, it opens but no record is being pulled up so the report pulls up blank.
Code:
DoCmd.OpenReport "rptSupplierInformation", acViewPreview, , "[OperationID]=" & [cboMoveTo], acWindowNormal
View 1 Replies
View Related
May 30, 2005
Dear All.
I have a visual basic function, placed in a module.
I need to call it from a form field, and pass a value to it and the function has to return a value.
I tried it but it doesn't work
the value I get on the field is " #Name? "
any help will be very appreciated.
Thanks!
CS.
View 8 Replies
View Related
Feb 9, 2014
I have created a custom message box form that suits my needs for this particular situation. It is called (opened) in the middle of a bunch of other VBA procedures. What I am having a problem with is how do I "pause" the rest of the code from running after the message box call?
For example, with a regular msgbox() function, once called, the code will wait for the user input or click of a button, then continue. My problem is that I am using the basic docmd.openform procedure, and it opens the message box form just fine, but then continues on with the rest of the code after the form is opened.
How would I "pause" the code after the call of opening my custom message box form, then continue it after the user clicks one of my closing buttons from that form?
Furthermore, although its not entirely needed in this situation, for future reference, how would I have that message box form return a value to the calling procedure?
View 14 Replies
View Related
Aug 31, 2014
There's a button(Button1) on the main form (Form1) and on the second form (Form2).On Form1, I've got a link(LinkToForm2) to Form2.When people click on LinkToForm2, I want access to open Form2 and hide/show Button1 depending on whether it is shown/hidden in Form1.
Is there a way to, maybe, set a value on Form1_Deactivate (depending on whether Button1 is shown/hidden),So that, on Form2_Activate, it can check that value and hide/show Button1 accordingly?
View 3 Replies
View Related
Nov 6, 2014
I have two form
first form contains many textboxes
second form is continuous and contains two textbox
I make a shortcut to the second form so i can open it with Shift+F1
Now when the form 2 open i want to double click on any row then the form 2 will close then the information well be copied to two specified textboxes in the form1
N.B form1 should still be opened when i open the form2
View 3 Replies
View Related
Mar 15, 2013
After filtering in the filter form, how do i pass the list4 value in the filter form to event form's scheduled list when i press add...
Attachment 11590
View 1 Replies
View Related
Dec 2, 2014
So Access was unable to manage the amount of content that I needed to produce in a single report. The reports contain 12 charts/graphs all of which I needed on separate pages (one chart per page). As such I could not create large enough charts in access to fit to each page, as Access limits the amount of space one can use in a report.
I downloaded Microsoft Reports Builder 3.0 and built my reports as needed and can generate them as desired at current. I'm wondering if there a way to call that RDL file I created to generate my reports from a form control button in Access?
View 3 Replies
View Related
Nov 26, 2013
So I have 2 forms, an Edit Lot Form, and an Add Run Form. Each lot will contain several runs. What I want to do is be able to add a run associated with the specific lot by pressing a button "Add Run" in the lower right corner of the edit lot form (see attached images). So the information for the lot will carry over to the run form and autofill the fields pertaining to the Lot in that form.
View 2 Replies
View Related
Feb 3, 2008
I know this is probably obvious but how do I pass through form variables to sql server I currently have:
exec QStudent @_param_cmbYear="0708", @_param_SelID="S", @_param_SelForename="d", @_param_SelSurname="S"
this executes correctly SelID being a student ID or partial ID also allowing for surname forename partial search. I thought it would just be:
exec QStudent @_param_cmbYear=[Forms]![Attendance and Lateness Main]![cmbYear], @_param_SelID="S", @_param_SelForename="d", @_param_SelSurname="S"
to switch acad year to a form variable and repeat for the others but it errors on trying to save the pass through. Thanks for the help.
View 1 Replies
View Related
Jan 21, 2015
I have a database that I am creating to enter risks and controls in for business auditing. I am stuck with a problem related to passing a value from one form to another. The general idea behind the database is this: A business enters its risks into a risk form and later enters its controls in the controls form. These are separate forms because the risk and controls may be entered at different times by different auditors. An example of what this looks like is this:
Risk Real estate owned by the company may be overvalued on the companys balance sheet.
Control Once every two years, the company obtains an independent appraisal of the propertys value.
A risk may have more than one control mapped (assigned) to it. A control may be assigned to more than one risk.Now that we know what the end result looks like, here is my problem.
Currently, I use a form to display the risk. This form has a subform on it which displays the control. I use a combo box on the subform to choose the controls ID reference number. When chosen, the control appears in the subform. This form then populates a join table which now contains the foreign key identifiers of both the risk and the control or controls. The problem is that the controls are wordy and stored in memo fields, so the user has to choose the controls identifier in the combo box, which is usually not know to the user. So, I have a button on the form the user can select and a report of all controls pops up so the user can scroll through and find the desired control and get its reference ID. They then close the pop up report and choose the reference ID in the combo box.
What I would like to do is to have the pop-up report appear as a form and each control had a checkbox next to it. Then the user could just check the box for the control they wanted. No more selecting reference IDs from the combo box.
View 1 Replies
View Related
Apr 19, 2006
Hi All,
I should know how to do this but my brain has gone blank.
I have a form "frmMainClient" which has a field "account_no".
On the main form "frmMainClient" I have a command button which opens a pop up form ""frmJobNew" where I can enter a new job record. The "frmJobNew" form has a field "account_no".
I am trying to auto fill the "account_no" field with the data from the "frmMainClient" - "account_no" field and store the passed data when the record is saved.
I can pass the data using "=forms![frmMainClient]![account_no] in the "account_no" field on the "frmJobNew" but when I save the record the data is not saved.
Can anyone offer help, please
Many thanks.
View 3 Replies
View Related
Sep 11, 2005
Hi
I am struggling with what seems like should be a straightforward task. Unexpectedly however it has become an infuriatingly difficult one (no doubt due to my complete novice status).
I have a very basic d/base (3 tables) that I have been searching using basic SQL queries. I want to create a simple 'search' form that produces the results of my various queries without the need to work in SQL. Enter one or more search criteria, hit ENTER, results presented in datasheet perhaps?
Thought this would have been easy but I've had no luck. Can you please explain how I can pass a parameter from a form to a query?
Many thanks
Stuck21
View 1 Replies
View Related
Jan 29, 2008
I am trying to enter dates in a form that calls a report that invokes a query that uses the dates. It has been a less then satisfying experience. I am getting a Run-Time error 3122. Is it possible and I need to work on syntax or do I need to think of another way? BTW how do I lookup the Run-Time errors?
Thanks for helping an old guy learn new tricks.
Jim
View 5 Replies
View Related
Feb 15, 2007
I have a query set up. I need to pass a set of current records ( as I select them in a drop-down menu) in a form to the query as parameters. How would I do it with or without VB? Thanks !
EDIT: Forgot to mention that all combo boxes are bound so they are not customized dialog-boxes which are unbound
View 3 Replies
View Related