Access Subform From A Different Form.
Mar 8, 2005
I have posted about this before andhave done some reading, but cant get it working no matter what I do.
I have the following forms:
SuppierOrderCreateNew
SupplierOrderCreateNewSubForm
Obviously "SupplierOrderCreateNewSubForm" is a sub forms on "SupplierOrderCreateNew".
There is a text box on "SuppierOrderCreateNew" called "supplierOrderNumber".
There is a text box on "SuppierOrderCreateNewSubForm" called "productNumber".
I then have a second form: "ProductSuppliers". I want to return a value from "ProductSuppliers" when a button is clicked on. When the button is clicked on, I want to put the value into "productNumber". However, I dont know how to refer to the text box.
I can put the value into "supplierOrderNumber" but not into "productNumber".
Can anyone help?
I have tried:
Forms![SuppierOrderCreateNew]![SupplierOrderCreateNewSubForm].Form![productNumber] = 10
But it doesnt seem to work.
Note: 10 is not the value I want to put into the textbox, its only a random value ive been using to test the statement with.
Thanks.
View Replies
ADVERTISEMENT
Dec 2, 2004
I have a form and a sub form. How can I create a dropdown/lookup field on the main form, which will find the customer details from the customer table, and then access the correct subform for their spend details?
I hope someone can help. Thanks in advance.
Regards
Peter
View 7 Replies
View Related
Feb 11, 2004
Hi,
I have a problem to make a search form in access, I want to divise my form, at the top will be the search criter (8 fields) and in details section will appear the result. I use a continuous subform with a query on the searched fields.
But I can't actualise or open the subform with the new results.
I would like a button to start my search or a system to automatically show the result on AfterUpdate event.
Can you help me, please? i trying to solve this for a long time...
Thank you,
Mrflo
View 13 Replies
View Related
Nov 30, 2005
I'm supporting some Access/VBA code which includes the following behavior:
When an update is made in a (linked) child form, the current date/time is written to a textbox on the main form via
Me.Parent!txtMod = Now
Likewise, the BeforeUpdate event of the main form updates the same field (and then does a bunch of form validity checks, possibly followed by a Save).
When we upgraded to Access 2003 from Access 2000, a problem erupted:
When the user returns to the main form (by clicking on any control outside the subform), the following message is issued: "This record has been changed by another user since you started editing it (etc.)..."
At this point the user must choose between "Save Record", "Copy to Clipboard" and "Drop Changes".
Conceptually, I see why this is happening (though I wonder why Access 2000 didn't flag it). The subform is the "other user". When the main form is returned to, it is "Dirty" (unsaved update), so the main form's BeforeUpdate event fires, and attempts to update the field again (Me.txtMod = Now). Since there is a pending change to the field, an error dialog pops up.
As a quick fix, I replaced the code in the subform with a flag ("Hey, I've been updated!"), which the main form checks on the Exit event of the subform control. But that seems a horrible solution. Surely there's a better way?
Notes:
1. It would be preferable to have the timestamp updated right away by the subform, though having it updated when the subform loses focus is better than nothing.
2. Since a subform is a control from the main form's perspective, I'm surprised that a change to that control doesn't render the main form "Dirty". I guess from a database standpoint it makes sense (the form's table isn't getting updated at all; just the subform's). But then, how does the main form know that the subform has been updated?
3. I tried catching the error via Form_Error. I can make the dialog not appear via "Response = acDataErrContinue", but unfortunately it defaults to dropping the changes (old and new), rather than saving the new.
View 14 Replies
View Related
Aug 8, 2014
I have a main form that has two subforms, subform1 and subform2, both connected to the main form. When I enter data into a field in subform1 I want subform2 to requery and update to show the calculated results from the new or changed data in subform1.
I found that if I do a refresh it works when changing the data but not when entering a new line of data in subform1. I tried some code in the after update field of on subform1, but cannot seem to get anything to work.
Me.[subform2].Form.Requery
Does not work. It errors and says it cannot recognize subform2 as a field. I have tried a field name on subform2 but I still got the same error.
View 1 Replies
View Related
Aug 19, 2015
I often move sub forms up and down within a form using something like.
Code:
forms!MyMainForm!MySubform.form.top = 500
However, I am having trouble moving a subform within a subform of a form.
Code:
Forms!MyMainForm!!MySubform!MySubformSubForm.form.top = 500
View 1 Replies
View Related
Apr 19, 2005
I am working on a massave aplication that has been running in Access 2000, but recently several of the file sharing users have installed Access 2003 because of the limited availability of Access 2000. All the users are using the same file off the server.
The problem we are having is that when we reference a subform in the "[Forms]![FormName]![SubformName]![FeildName]" Access 2003 does not recognize it and returns an error. I have found that if I will modify it to "[Forms]![FormName]![SubformName].[Form]![FeildName]" it is recognized in both 2000 and 2003.
To try and change every instance of a subform reference will take forever and I am garuteed to overlook something. We reference subforms all over our program, missing any one of them would be a disaster. Before I went to the tedious task of looking through everything I just wanted to throw the situation out there and see if any of you had any great ideas on how to get it fixed efficiently. I would apreciate any ideas.
View 5 Replies
View Related
May 3, 2013
I'm working on the Navigation Form template in Access 2010, which is new to me. It appears that one needs to use the BrowseTo command to open up a form in the built-in subform module. I'm trying to create a couple of buttons where each button opens a form in a different data mode; one in read-only and one in add mode. Here is the syntax I used for read-only:
DoCmd.BrowseTo acBrowseToForm, "frmSales","frmNavigation.NavigationSubform", , ,acFormReadOnly
frmSales is the Sales form I want both of the buttons to open and frmNavigation is the Navigation form. It seems to be ignoring the data mode part at the end however. It only will open in Edit mode. Is there something I'm doing wrong with this command?
View 3 Replies
View Related
Jun 2, 2014
Basically I need to design form that looks very similar to either Split Form or Subform. I have attached a print screen of what I roughly need. The form is split into two parts. In the first/top part there are some List Box/Date fields that act as filters to the bottom form, so the bottom form displays only records that match values in red. The second part of the top form has some field that require input from user and then these records are added to the bottom form. I was trying to use both Split Form and Subform and none of it is working,I have attached an example of database and this form would be based on data from Query1.
View 5 Replies
View Related
Aug 19, 2013
I tried all sorts of permutations of the requery command but apparently I'm too dense to figure it out.
Form 1
subform 1 > button to open pop up form
subform 2
subform 3
I'm trying to requery a combo box (inside of subform 1) based on a table that is updated from the pop up form.
On pop up form close, what's the correct syntax for re-querying subform 1?
View 2 Replies
View Related
Aug 22, 2014
How to populate the parent form's PK to multiple records in a child subform set to a default view continuous form?
In other words, how to auto populate the primary key to multiple records displayed the subform?
View 5 Replies
View Related
Jan 26, 2015
I have created a master form, which is a tab style. I have five additional forms that I want to use as sub-forms within each tab. I also want to include master navigation buttons that will work for each sub-form in unison. In other words if I navigate to record 10 on tab 1 and switch to tab 2, I want the new tab to show the information related to record 10. It would appear that I need to link them together in some fashion.
View 1 Replies
View Related
Feb 18, 2005
I currently have a couple of problems with an input form set-up.
I have a main form (frmWebSites). On this form I have a TabBar and one of the Tab pages holds a subform (frmSiteDetails). Within this subform I have a simple option group to select between 2 further subforms that are themselves subforms on frmSiteDetails (these are frmWebSites_pgeSiteDetails_Features and frmWebSites_pgeSiteDetails_Membership). I have coded the option group to make one sub-subform visible and the other invisible and vice versa depending on what option is selected.
This procedure I call from the Click event of the option group, both the Current and Load events of the frmSiteDetails.
The controls that exist on each of the sub-subforms are bound to the same table tblWebSites as the controls on the main form (frmWebSites).
The selection between the sub-subforms works perfectly well between the 2 forms when I am on an existing record and am just viewing the data.
1. The first problem arises if I want to change the data on one of the forms.
If I change a value in any of the check boxes or combo boxes etc and then try and select the other sub-subform I get the Error message 'The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the record.'
I can OK this and select the option button again and the page changes as it should and the data has been updated.
2. The second problem arises with new records. If I try to enter a new record by entering details into controls on the main form everything is OK. I then try to enter further data on the currently visible sub-subform, but as soon as I then try and select the option to make this form invisible and the opposite sub-subform visible I get the following error.
'The field 'tblWebSites.SiteName' cannot contain a null value because the Required property for this field is set to true. Enter a value in this field.'
I don't understand why this is saying it is a null value as this is the first piece of data that is entered into the form. Furthermore I don't understand why it is looking at the value of this field at the time it does.
This locks me up. I can still enter data in the remaining fields of the currently visible sub-subform but not change to the other.
Any ideas where my problem lies??
Please be gentle with me, I am a complete new boy at this and this is my first Database.
Regards
Jama
View 1 Replies
View Related
Aug 10, 2005
I do not know if this is possible but I am trying to use a subform in a subform. Meaning I have a picture(picsubform) which is in a subfrom(frmPicExample) both of these are in a form(depot tracking). The goal of this little experiment is for every record of an item it will have the ability to add, delete, next, previous etc. to allow more then one picture to be linked to one record. My problem is that I am get the following error:
(Microsoft Office Access can't find the form 'FrmPicExample' referred to in a macro expression or Visual Basic Code)
the follow is where the debug lands...
Private Sub Form_Load()
OrigHght = Forms!frmPicExample!picsubform![imgPicture].Height
OrigWdth = Forms!frmPicExample!picsubform![imgPicture].Width
End Sub
how do I add the primary form called depot_tracking?
Thank you again
roborro
View 1 Replies
View Related
Oct 23, 2014
I'm trying to open a form with a subform from a separate form. I've never had any issue before, but all of the sudden, the subform doesn't seem to open immediately. I get the error
Code:
Method 'Form' of object '_SubForm' failed.
After that, it opens (subform and all), but some calculated text fields just say "#Name?#"
The only thing I did today was add a command button to that subform.
When I try opening the form (or subform) from the navigation pane, I get
Code:
The expression On Current you entered as the event property setting produced the following error:
A problem occurred while Contracts was communicating with the OLE server or ActiveX Control
When I step through the code, it doesn't reach the On Current event.
View 5 Replies
View Related
Dec 20, 2011
I'm working on a project that has two tables. "Calls" and "Customers". The Customers form has a subform, "Calls Subform" in it. When you click on the (New) Hyperlink a new form opens, "Call Details". I would like to pull information off of the "Customers" Form and insert it into the newly opened "Call Details" form.
Problem #1) Home Phone (named "Phone" and Text223 (named "CID"): are both bound controls so I have to do this in an OpenArgs type process.
Further details:
On "Customers" the following is true:
"25" is the "ID" for that customer on the "customers" table
"Home Phone" is the home phone number on the "Customers" table
On Call Details the following is true:
Home Phone is Bound to a table "Calls" and needs to pull it's data from Customers Form..Text223 is CID and bound to the table "Calls" and needs to pull it's data from "Customers" form.
View 14 Replies
View Related
Mar 28, 2005
Hi all :D
Background:
I have a few tables, (products, Customers, Backorders, NewCustOrders)
And 2 main forms using a couple of subforms. One of the main forms has 2 tabs; Tab 1 shows current products list, Tab 2 shows back order list.
The other Main Form has 3 Tabs; tab 1 has the customer details, (that part is fine), Tab 2 has a couple of fields used from the first tab and a subform which is ment to be the customers order., Tab 3 is ment to show customers order history.
On tab 2, new order subform
I have 6 fields, ProdName, ProdSize, UsebyDate, ProdQuantity, Prod-R-Price, TotalCost.
Prodname and prodsize are combobox's
Totalcost is calculated from prod-r-price*ProdQuantity.
Main problem:
1)
I am trying to get the prodName to list each product Once only, not once for each entry in the table. How do i filter the combobox so it will only show one product name, even if there are multiple entries in the products table.
2)
Trying to filter the prodsize to only show available sizes of selected product - (From first question). not every size in the table as it currently shows.
This is driving me Nuts, i have looked for the last 4 months in over 60 books, allover the web, and asked anybody who has had anything to do with access. NO ONE KNOWS THE ANSWER!!!!!!!!!! :eek: :eek:
Thanks
Peter
View 1 Replies
View Related
May 5, 2005
I have a sub form that shows items booked for a person, this subform is refreshed everytime a new item is booked. I want to be able to add commission so I have a combo on the main form that has commision rates in it.
I have a click event on the row in the subform with the hope that I could click a particular product and then if user clicks the description then the click event will add the commision due on that particular item.
the row is [prodid] [desc] [cost]
the question is how do i access the row data on the subform?
in this case I have grabbed the commission rate from the combo and now want the cost from the row i clicked.
regards in advance
peter
View 4 Replies
View Related
Jul 19, 2006
Hello All,
I have a bit of a problem. I have a main form with two subforms. The subforms are linked to the main form my two fields. The main form and subforms are each based upon a different query.
I have written VBA code that filters the SQL statements of the subforms based upon the value of the the REV field on the main form. When the user changes to different record on the main form, the subforms are supposed to change accordingly.
The problem is that the subforms on the main form will not refresh each time the user chooses a new record on the main form. If I change to a new record on the main form and then open the subform outside of the main form, the correct information is shown. The problem however is that the subform shown on the main form does not automatically refresh. I have tried numerous strategies, but to no avail. If I am on a record in the main form, and I exit the main form, and then re-open the main form, the subform data on the main form will reflect that of the record I was on prior to previously exiting the main form.
Here is some of the code that I have tried:
Me![qryRevText_ sf].Form.Requery
Me![qryAdminRevText_sf].Form.Requery
Me.Refresh
or
Me.[qryRevText subform].Form.Refresh
Me.[qryAdminRevText subform].Form.Refresh
or
DoCmd.Close acForm, "qryRevText subform"
DoCmd.Close acForm, "qryAdminRevText subform"
Please help me if you can. I would appreciate it greatly.
Thank you in advance.
Akagami
View 14 Replies
View Related
Jan 26, 2005
Hi,
I have two subForms on separate pages of a Tab Control on a main form. I want to create a Textbox on one Form to display the month of a Date field on another form, using DatePart.
Using the On Current event, this works ok, if I have the 'other' subForm open in its own right, but I get message telling me it can't be found if i don't. Here is what I have...
Private Sub Form_Current()
If Not IsNull(Forms![Reviews]!SelectLessee) Then
Dim revDate As Date
revDate = Forms![subReviewPEST]!DateOfNextCreditReview
Me.Text118.Value = DatePart("m", revDate)
End If
End Sub
What syntax do I need, or how then can I access the control without having the subForm open itself, by getting to the page on the tab control, then to the control on the subform...
View 2 Replies
View Related
Sep 12, 2005
Hi,
I'm trying to requery a subform within a tab after I select from a combo box in the main form. Can anyone help?
Or just to simulate the "refresh" button click within a macro?
thanks
Jeff
View 4 Replies
View Related
Dec 20, 2007
How do you pass a primary key to an append query from a subform?
Example:
Main form Table Subscriber (subscriber-id primary key)
Linked (subscriber-id (main form) = ot-subscriber-id (subform))
One to many
Sub form - Other residents (ot-othres-id primary key)
From sub form append history record using primary key by query
With in query criteria [forms]![other residents subform]![ot-othres-id]
Does not work The primary key isnt being passed which shows in the subform. Pop up box appears.
View 12 Replies
View Related
Jun 20, 2006
I am having problem linking data in a form to a subform.
What I have is a form that contains the name of a project and the description of the project. That form then includes a subform that lists the various progress reports for that project in a tabular form.
I have a database to keep track of the link between the project and the various progress reports that it can contain. My problem is when using the Form/Subform to create new progress reports, it is not creating the necessary values in the table to link the project and the new progress report together. Any help would be appreciated!
Here's a screenshot to give everyone a better idea:
http://img220.imageshack.us/img220/4442/temp5ua.th.jpg (http://img220.imageshack.us/my.php?image=temp5ua.jpg)http://img111.imageshack.us/img111/5753/temp26eg.th.jpg (http://img111.imageshack.us/my.php?image=temp26eg.jpg)
I would post the DB but it's to big according to forum attachment size limits.
TIA!
View 6 Replies
View Related
Sep 25, 2006
I'm trying to develop a simple company price list. I have created a suppliers products table. But I want to use the suppliers products to make up our coded goods (A Bill of Quantities simply). But I'm caught in a certain area that I dont have any knowledge on.
I want to create a form / subform whereby I can create my company codes, add up the cost price and put mark on it.
I have attached a image of what I'm trying to do in excel. In excel all I do is enter the code and the descrition and price comes up in the cells automatically. I just enter the quantity I require and total (sum) it all up.
In the subform itself. I can't get the the rest of the text boxes to automatically update once I have entered the code in the combo box. I rekon I have to enter a event procedure. Can some
one help
View 4 Replies
View Related
Apr 13, 2005
is anyone has idea about how to undo update for subform?
i have a parent form(linked to A table) and a subform (linked to another table). the parent table has two button-save and cancel. i was wondering how the subform cancel update if the parent form's cancel button has been clicked? the code Me.undo will undo the parent form's record only, since the subform record has been saved into access.
View 1 Replies
View Related
Feb 27, 2015
I have a subform which is created with textbox and some command button in the top of the window, so this will simulate like a Datagrid.
[URL]
This is how it looks my datagrid when it fills from a Query.
[URL]
What I want is when I select a row from my subform, I want to Click the button "Cambiar", and get the value of the machine selected.
[URL]
View 4 Replies
View Related