Populate Form2 With Form1's Subform Data
Feb 8, 2006
I have a form where a different form opens up when a user clicks a certain button. What I’m trying to do is assign a field value from form1's subform to a field on form2 and it’s telling me "Run-time error ‘-2147352567 (80020009)’, You can’t assign a value to this object." I'm new to VBA, but think I'm on the right track. Could someone please tell me what I’m doing wrong.
The code I'm using is: Me.txtStoreNo = [Forms]![frmCDRData4REF]![sfrmCDRData4REF].Form!txtStoreNo
View Replies
ADVERTISEMENT
Sep 6, 2013
I have a database of books. I have a combobox listing 3 different status W M R.
W is for Whats next to read, M is for more books too read and R for books read or reading now. I can enter a new book by calling up the add a book form from any of those 3 forms.
If I forget to enter a letter in the combo box then the book is lost to those 3 forms as what they see depends on that status letter and I have to go to the table and enter a letter from there.
I want to know if I can auto populate the field (W M R) depending on which form opened the add a book form.
View 3 Replies
View Related
Jun 30, 2005
Hi,
I've searched but cant find the answer,
I have an Account form (Form1) and it displays account information along with their many addresses for the account (in a datagrid embedded form). I hit "update or add address" button to launch form2 (Address Form). From this point I want to query the Address and AddressAccountLink table with a passed in Global Variable (AccountID) from Form 1 so that just the Addresses pertaining to that Account show up, instead of all the Addresses for all accounts.
How do I do this? I've tried a String Query in the Private Sub Form_Load() but it gives me errors, here that is:
sSQLQueryAddr = "SELECT tblLinkAccAdd.AccountID, tblLinkAccAdd.AddressID, tblAddress.* FROM tblAddress INNER JOIN tblLinkAccAdd ON tblAddress.AddressID = tblLinkAccAdd.AddressID WHERE (((tblLinkAccAdd.AccountID)=" & v_accountid & "))" (it's on one line in the code)
followed by:
DoCmd.SetWarnings False
DoCmd.RunSQL sSQLQueryAddr
DoCmd.SetWarnings True
Any ideas? Am I on the right track? Do I move this query elsewhere? The address form is made from a query -- querying the Address and address/account link table.
Oh, the v_accountid does have the correct value passed to it...
Please help , I'm going nuts here!! :confused:
Mike
View 12 Replies
View Related
Dec 4, 2013
I have 2 form, form1 and form 2 (picture attached)
In Form 1
(main form) there are "reference" field with key pressed event
then call form 2 (list of reference that user can choose)
In form 2
the problem is, when "enter" key pressed (keypress event), selection will move to next record
so the data that transferred to form 1 is wrong (next record)
The question is : how to save current record in form 2 before enter and send the data to form 1
View 3 Replies
View Related
Sep 20, 2006
Hi all,
(Refer to Figure1 pls) How can i bring the value from form1 to form2 after i click the save button?
Regard,
alex
View 7 Replies
View Related
May 25, 2005
I have 2 forms which are based on separate tables. When I open Form2 from a command button on Form1, I would like the common boxes on the Form2 (name, ID #, ets.) to automatically copy the info from the boxes on Form1 with the same names. How can I do this? TIA
View 5 Replies
View Related
Dec 12, 2006
What line of code do I need to requery a listbox on Form1 when I close Form2?
I'm pretty sure I need to put it in the OnClose Event of Form2, but I don't know how to reference the Listbox on Form1.
Thanks
ScrmingWhisprs
View 4 Replies
View Related
Jun 15, 2006
I need to make a query work so that when someone enters info into a master form, it will pull the data for that job onto other forms when the job # is entered. Thanks for any help.
View 1 Replies
View Related
Sep 11, 2014
I am trying to get the Primary Key value from one form to auto-populate the foreign key value of a second form
I have tried the following code in both the second form's Load Event and the Foreign Key Control Got Focus Event but nothing doing...
Me.[NHS Number] = Forms![frm_Patient_Data_Entry]![NHS Number]
I am new to VBA so not sure of the referencing technique but have looked at the MVPS Form 'referencing' sheet to no avail.
I keep getting an error message (2450) MS Access cannot find the referenced form "frm_Patient_Data_Entry"
I have checked spelling throughout countless times so there must be something wrong with my referencing I guess.
View 2 Replies
View Related
Nov 24, 2014
I have a Lost/Found property database which we use to keep record of the lost/found property and its working fine.
The database has one table and two forms.
One form (LostFoundForm) is visible to the user in which they enter data, this form has two sections; Item(s) & Finder's details and the second section is about Restoring details.
However the second form (ClaimReceiptForm) is hidden to the users (for manual data entry) and has only one section which is exactly the same as the first form's first section, i.e., Item(s) & Finder's details. This second form takes the data automatically from the first form because the table behind them is same and fields are same (please see attachment). Up to here it's all working fine.
I would like to introduce a Checkbox or a CommandButton in the LostFoundForm which when we click should pull up a msgbox asking "Do you want to print the receipt for this item(s)?" with a Yes/No option. On clicking "No" it should, obviously, settle down but on clicking "Yes" it should print the "corresponding record" from the ClaimReceiptForm.
View 1 Replies
View Related
Dec 11, 2005
I have 3 inputs based on which i'll fetch records from table in a subform for the given input criteria. Please let me know how to populate subform programmatically?
I tried source object property and form.recordsource property. It gives me some error or the other. let me know the right syntax to do the above mentioned.
Thanks in advance,
jwala :)
View 1 Replies
View Related
Jul 23, 2006
Hi all I have a data input form (Form1) In has various lookups based on input data, then the values are saved to a table. It has a print button to print data on form. It also has a return button (which runs a append and delete qry via a macro ) When the return button is pressed i need to print a different form (Form2) Do i need to lookup the table data with code or can Form2 ? Anyone point me in the right direction
View 2 Replies
View Related
Nov 29, 2013
I want to append/populate all data from one table to subform?
It is possible?
I managed to populate data from one table to another but my relations between form and subform isn't good, because record that is supposed to be filled as the "link master fields" is left blank.
View 3 Replies
View Related
Dec 15, 2013
I have:
Tables: Customer and Orders
Relationship: Customer ID is the primary key in Customer and is a foreign key in order table.
I need to create a Form with contains all the customer info from the customer table, as a drop down list. Once the customer is selected, all their orders should appear in a subform. At the minute I can get a form to work which shows all the orders but you have to go to the next record so see the order. For example it will say John smith and one order. The next record will be John smith again and their second order in the sub from.
I have used access in the past and I am fine with creating everything apart from the drop down. I am just a bit lost with the structure.
View 2 Replies
View Related
Mar 2, 2007
Hi,
I have a form with a subform, Both of them are based on a query.the form
displays a productid and its details ,and the subform has matching
productnames for that productid.
Now i have a search on the main form wherein the user enters ( search
for) the productid, once they click search button, the form should show
that particular prod id and details and subform loaded accordingly with
that productid matches...seems simple but how do i code this in VBA??
Basically populating the form and subform with data based on search..
i am using ODBC coonxn with backend oracle tables..
any help would be highly appreciated!
Thanks
View 2 Replies
View Related
Aug 20, 2013
I have an unbound combobox on a form that is used to filter the records of a subform based on who they have been assigned to. The combo box is based off of a query to the personnel table and utilizes a UNION querry to add the option "**ALL**" with a id number "111111" as the first option in the combo box.
In other words: the combo box has a list of names to choose from and the word "ALL" at the top as the first selection. The idea is that when "**ALL**" is selected, the subform should display all records regardless of who they have been assigned to. I'm trying to accomplish this with VBA. I've started developing the code to try to impliment this, however currently when "**ALL**" is selected, I'm getting a datatype missmatch that seems to be caused by my use of recordset.
Option Compare Database
Option Explicit
Private Sub cboTaskListName_AfterUpdate()
'On Error GoTo cboTaskListName_AfterUpdate_Err
Me.Refresh
[code]...
Also once the queried records are saved into the record set, how can I communicate that to the subform so that it displays them?
View 2 Replies
View Related
Jan 27, 2006
Hi,
I've got a main form with some unbound fields and a subform. From the unbound fields in the mainform, I modify dynamically the RecordSource of my subform to display the information. ==> This works fine !!
When there is no information to display in my subform, I need to create a new record in my subform and populate automatically some of the fields in my subform.
The problem is that I am not able to use the GoTorecord,, acnewrec in the subform because Access tells me that the subform is not open. If I try to use the Openform command, I get a new subform window on the screen and that's not what I want because the subform is already displayed.
Here is part of the code:
DoCmd.OpenForm "Subform name"
DoCmd.GoToRecord acDataForm, "Subform name", acNewRec
:confused:
Cheers.
Fab.
View 4 Replies
View Related
Dec 10, 2004
i have a form frmCreditNote with a subform sfrmCreditNote. They are linked by a creditNoteNumber.
As soon as i pick a customer in the main form, i want the first line of the subform to have that customer name as well.
If I change the customer name in the main form, I need the first line of the subform to correspondingly change as well.
If the form was new, i would open a recordset and use .AddNew to put in the new first line date
If I was updating the form customer name, then I would need a .Edit to change the first line of the subform.
My question is : how do I determine if the subform is empty? Is it a command likeIf subform.HasData, orIf IsNull(?)Please let me know thanks
View 1 Replies
View Related
Sep 4, 2014
I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?I have tried on afterupdate event on Contact_Details below but those don't work:
Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
View 11 Replies
View Related
Aug 5, 2005
I have the following tables:
tblProjects
ProjectsID (Primary key - exclusive)
ClientProjects
tblProjectsDetails
ProjectsDetailsID (Primary key)
ClientProjectsDetails (Secondary key)
tblQuotes
QuotesID (Primary key - exclusive)
ClientQuotes
Service
Rate
tblQuotesDetails
QuotesDetailsID (Primary key)
ClientQuotes (Secondary key)
Service
Rate
I have the following forms:
fmProjects
fmProjectsDetails (parent/child)
fmQuote
fmQuotesDetails (parent/child)
When I add a project I need to have data from the tblQuotes and tblQuotesDetails to populate tblProjects and tblProjectsDetails respectively.
It is very easy to populate tblProjects from tblQuotes since it is a single record. Therefore I use:
Me.ClientProjects = Me.ClientQuotes
:confused:
The question is: how to match the data of the 2 subforms? Since there will be more than one record per subform?
Any help is really appreciated.
View 2 Replies
View Related
Jul 12, 2005
Hi,
I'm not even sure if this is possible to do (I havn't found anything on the Net yet), but I have a Form displaying Customer information, and the vending machines that customer has.
The main form (frmAccount) has 2 SubForms:
1) AddressSubForm (is a Datasheet), listing the many addresses the one account has.
2) VendingMachineSubForm (is a Continuous Form) and displays the machines related to the account.
What I want to do is select an address in the datasheet, and have the MachineSubForm populate with what machines are located at that address. Can this be done?
The Machines and Addresses link by AddressID. Both subforms are built on queries.
Thanks for any help/insight!
Mike
View 14 Replies
View Related
Oct 19, 2006
I have looked at multiple samples on this forum and others and cannot seem to get the result I want working.
Have main form TmLdr made from table of same name. Entries include ReqName and CostCenter. These same entries are on a subform. On the After Update event on the CoRecDt (main form), I want the name and CostCenter entered on the subform to populate on mainform. This subform will be filled out by the user once and as long as they are using their own machine there will be no need to re-enter their name.
I think that I am so close but just a touch away. I am attaching my DB with hopes someone can take a peak at it and let me know what I am missing. Thanks so much.
View 1 Replies
View Related
Aug 26, 2004
I have a subform that is populated with records, filtered by two combo boxes on the main form. I would like to be able to double-click on one of the records in the subform and have it populated in the main form for editing.
Any help would be greatly appreciated.
Best regards,
MrAviator
View 5 Replies
View Related
Feb 14, 2014
I've got an access front-end database running on Access Runtime on a Terminal Server with a back-end on a data server both of which are hosted by a remote company and accessed via Terminal Services. All is well and the database is working fine but because this is a cloud system I need a way that I can easily delve into the tables on the back-end without copying it down locally from the cloud each time (I've set up an "administrator" option so that this would be available to limited users). I've got the front-end forms working as I'd like but I have quite a few tables and I'd like to avoid creating a separate form for every table. I've been able to populate a combobox on my form with the list of linked tables and I'd like that when I choose a particular table from this list that the whole table is then visible within a subform below in case I need to manually intervene with the data for any reason.
View 1 Replies
View Related
Mar 21, 2014
I am trying to populate a txtBox on the SubForm of a Form, Using a Set Value Function = DlookUp function. The DlookUp Function searches for a value in the table and compares it to a value of another txtBox of the subform .The problem is:
-Using the Left Switch on Mouse works fine, txtBox is populated correctly
-Using the Enter Key does not work; it clears the box used for the seaech data and does not populate the txtBox.
I tried placing the procedure in the After Update event and also placing it in the on Enter event to no avail.
View 1 Replies
View Related
Jun 24, 2015
I have a continuous subform with an unbound Concat textbox and would like to populate another field for each record with the results with a main form button onClick event.
How do I accomplish this?
View 2 Replies
View Related