f



repost calling a subform from another form(not main form)

Hi,
I have a MainForm and a SubForm. I also have a popup form that is
opened by a button click on the subform. On that form I want to set the
main form and subform.

to set mainform you do this:
dim f as form
set f = forms("MainForm")
---this works

I don't know how to set the subform though...
I tried this:
dim sf as subform
set sf = forms("MainForm!Subform") but this does not work...

any help appreciated...using Access 2000.
Thanks

0
gevayl (168)
8/27/2005 4:19:43 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

4 Replies
439 Views

Similar Articles

[PageSpeed] 25

set sf = forms!MainForm.Subform.form
If your form name is not a variable It's also faster to refer to the
objects explicitly e.g. forms!Myform as opposed to forms("Myform")
HTH
Pachydermitis

0
dedejavu (91)
8/27/2005 5:04:12 PM
I have to use Forms("string") since the subform declaration is a
string...
Is there anyway I can do what you wrote above "set sf =
forms!MainForm.Subform.form" with useing the forms() function...?

0
gevayl (168)
8/27/2005 5:16:34 PM
You should read Keri Hardwick's article about referring to subforms and
subform controls etc on access web.  www.mvps.org/access - go to
Search, type in "Hardwick" and there should only be a handful of
articles.  You can't miss it.

0
pietlinden (2926)
8/29/2005 3:26:39 AM
set sf = forms!MainForm.controls("Subform").form 
HTH 
Pachydermitis

0
dedejavu (91)
8/30/2005 4:22:31 AM
Reply:

Similar Artilces:

Forms/Subforms in MS Access Database
Why do my Forms/Subforms in my MS Access Database not appear? All I see is the boxes where they should show?! What did I do wrong? Thanks, John zufie wrote: > Why do my Forms/Subforms in my MS Access Database not appear? > > All I see is the boxes where they should show?! > > What did I do wrong? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Probably there isn't a name of a form in the sub-form's Source Object property. Also, the Link Child Fields and the Link Master Fields properties may be blank - you must enter the names of the link fields, they hold the field names that link the data between the forms. -- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBSSsUjoechKqOuFEgEQL+dQCfYUSwXFtPj0RRSZO+q3J8lQCD0/UAniRz JKu0h9AG0BAg8W3wC/0BC7B3 =Kvva -----END PGP SIGNATURE----- On Nov 24, 2:54=A0pm, MGFoster <m...@privacy.com> wrote: > zufie wrote: > > Why do my Forms/Subforms in my MS Access Database not appear? > > > All I see is the boxes where they should show?! > > > What did I do wrong? > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Probably there isn't a name of a form in the sub-form's Source Object > property. =A0Also, the Link Child Fields and the Link Master Fields > properties...

calling a form sub from another form
Hi All This might sound simple, but I'm stumped. In essence I have a 2 form app that connects to an SQL db and extracts info from it. This works fine. The problem is with my 2nd form. The 'run through' is that the user can select an inv no from a combo box on form1 and when they select one, I auto-extract info from a db relating to this inv no, concat the various data fields with 2 other text fields (contains footer info) that are on form 2 and present it in a large text box on form 1. This also works fine. The problem is that the user may be previewing the large text box da...

Hiding Access Main Form/tables/queries/forms/etc
Thank you in advance for any and all assistance. Is there a way to hide the Main Access window with tables, queries, forms etc programmatically? Michael On Sat, 17 Jan 2004 17:17:16 -0600, "PMBragg" <pmbragg@megavision.com> wrote: >Thank you in advance for any and all assistance. > >Is there a way to hide the Main Access window with tables, queries, forms >etc programmatically? > Yes. Take a look here for some API code that will manipulate the Access window. http://www.mvps.org/access/api/api0019.htm - Jim Another way, with probably less control than the...

Forms question
Hi folks, I'm new here and am a neophyte Access 2000 user/developer. A year ago, I barely knew what Access was. I was asked by the people that pay us to begin keeping certain data about the children's crisis program I manage. After a couple of years doing this by hand on paper (Yikes!), I decided that this was ridiculous. Out of neccessity, I had to learn Access and develop a database to track clients and services. So what I know, I've learned from places like this and from the many text books I've picked up. I developed the database and entered almost 3 years of data. We av...

Want to search subform but accross all records in main form and return the corresponding record in main form
I'm working on a DB where I have a main form that has customer info and a subform that contains order details related to that specific customer. I have a text box and a command button on the main form that I'd like to be able to use as a search function. What I'm trying to do is search the subform for a purchase order number and have the corresponding customer record brought up in the main form. I'm having some problems because the subform, by nature, is limited to only showing records related to the customer ID that is presented on the main form so I'm not able to search over all customer records. The subform is called "frmOrderDetailsSubform", the text box is "SearchText", and the field on the subform that i'd like to search is "PurchaseOrderNumber". Any help or insight would be greatly appreciated. The code I have right now looks like this: Private Sub SearchButton_Click() On Error GoTo Err_SearchButton_Click Dim stSearchText As String Dim PurchaseOrderNumberVar As String 'Check SearchText for value. If IsNull(Me![SearchText]) Or (Me![SearchText]) = "" Then MsgBox "Please enter a value!", vbOKOnly, "Invalid Entry" Me![SearchText].SetFocus Exit Sub End If stSearchText = Me.SearchText Me.frmOrderDetailsSubform.SetFocus DoCmd.FindRecord stSearchText, acAnywhere Exit_SearchButton_Click: Exit Sub Thanks, Matt majalo22...

Query By Form Using Same Sub Form and Main Form
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on another main and sub form. The requery on the sub form and refresh comands on the main form do not work when the form is first displayed and when the selection criteria is changed. Should I be doing a refresh and then repaint of the sub form. > ' Creates saved query in the database container for the sub form Call BuildSql("") ' The following commented line correctly displays query results on a seperate sub form that has the results from the criteria selected on the form currently in use. 'Docmd.OpenForm "MainFormSeachResults ' The following two lines attempt to display the results on a sub form which is on the same form where the criteria is selected: Me.frmSubFormResults.Requery Me.Refresh < Hi Tom, I often use an unbound main form to collect criteria, then show the results in a datasheet-style subform. I create the SQL string using code, and then use that string as the Recordsource for the subform directly (no need to save it as as query in the the database container) As an added bonus, the subform refreshes automatically ... no need to "Refresh" or "Repaint" anything. Here's some sample code to illustrate: - lstFieldNames is a listbox containing field names ... which is one of the choices in the listbox&#...

How can I call up a form based on a field value in my main form?
I have a database about services and installations as well as warranty and services for a company I run. The main form is the customer info form. On this I record names, address and phone numbers. The first field, though, is an autonumber field I use as customer ID. This is the main identifier so that I can have 2 John Smith's. I have forms for warranty, service, quotes,referrals etc, all are called up by using a command button for that form. Each of these forms also have the Customer ID field, formatted as number but not autonumbering. If I press he command button for warranty, I get the ...

Calling AfterUpdate and OpenArgs in Opening a Form from within another Form
Hi there, I am trying to call the afterupdate event for a combobox in an editing form from the double-click event of a combobox in a first, non-editing form, and get r-t error 2465. Argggg! Private Sub cboClients_DblClick(Cancel As Integer) DoCmd.OpenForm "frmSelectClients", acNormal, , , , , Me.cboClients Forms.frmSelectClients.cboClientsSelect = Forms.frmSelectClients.OpenArgs Call Forms.frmSelectClients.cboClientsSelect_AfterUpdate I am trying to use the open args only if users double-click the combobox in the non-edit form; I have a cmdbutton for Add a new record which opens up the editing form to a new rec. The 2 unbound comboboxes: cboClients, and cboClientsSelect The reason is because I cannot do the openargs in the on open event of the editing form--in order to add new records and have the comboboxes work. Your help would be so greatly appreciated. Thanks, Eric in frmSelectClients, try changing the combo control's AfterUpdate procedure from Private Sub cbo... to Public Sub cbo... hth "Arnold" <ericarnold1@yahoo.com> wrote in message news:1187556978.715547.276790@x35g2000prf.googlegroups.com... > Hi there, > I am trying to call the afterupdate event for a combobox in an editing > form from the double-click event of a combobox in a first, non-editing > form, and get r-t error 2465. Argggg! > > Private Sub cboClients_DblClick(Cancel As Integer) > > DoCmd.OpenForm "frmSelectClients&qu...

Calling a subform function from a main form
How can i call a subform function from a mainform ? -- Posted via http://dbforums.com "vindude69" <member39791@dbforums.com> wrote in message news:3375582.1063719974@dbforums.com... > > How can i call a subform function from a mainform ? Assuming the Function is not declared as private: x = Me.NameOfSubFormControl.Form.MyFunction ...

Making MS Access Form as a standalone form like in VB
Well, its sames difficult for me; I love access so much and wish to make it perform extra task. I prepared an HTML form but can not connect it to my access table and so I think it is possible to make an access form a standalone form for user input. Can anyone assist. My mail add is dianafather@aim.com. *** Sent via Developersdex http://www.developersdex.com *** Oscar, why don't you just code up a VB form for user input and connect it to an Access backend? To my knowledge, you can't force an Access form to exist outside of Access. Your users would have to open the Access file to enter data, no matter how you set up the Access form. On Tue, 20 Dec 2005 11:35:09 GMT, Oscar N. Goyee <dianafather@aim.com> wrote: It's poor newsgroup practice to ask for email responses. Unlike what Steve said, you can create a form that lives outside of the Access main window: make it a popup. There is also nifty code out there (google for it), that puts the Access main window behind that popup, and moves it with it when it moves. To the end user it appears you have a single-form application. -Tom. >Well, its sames difficult for me; I love access so much and wish to make >it perform extra task. I prepared an HTML form but can not connect it to >my access table and so I think it is possible to make an access form a >standalone form for user input. Can anyone assist. My mail add is >dianafather@aim.com. > > > >*** Sent via Developersdex http://ww...

Forms and Form
Hi everyone ! 1) An example from help: "Each Form object has a Controls collection, which contains all controls on the form. You can refer to a control on a form either by implicitly or explicitly referring to the Controls collection. Your code will be faster if you refer to the Controls collection implicitly. The following examples show two of the ways you might refer to a control named NewData on the form called OrderForm: ' Implicit reference. Forms!OrderForm!NewData ' Explicit reference. Forms!OrderForm.Controls!NewData The next two examples show how you might refer to a ...

Accessing data from one form from main form in Visual Basic 6
How do I extract data from a form into the main form for processing? For instance, I have several image files in a form called images(images.frm), indexed from 0 to 99, and I want to import these into a variable array in my main form, main (form1.frm). How do I code a control to get these images into an array in my main form from the images.frm? TIA JC wrote: > How do I extract data from a form into the main form for > processing? For instance, I have several image files in a > form called images(images.frm), indexed from 0 to 99, and > I want to import these into a variable...

Form size question with Access forms, remote desktop, and MS Surface Pro
Hi, I know this is a stretch to ask this question, but: We have an Access 2010 application hosted using Remote Desktop. When we access forms from the desktop they look like they should. And from an iPad. However, a client is using their Surface Pro the forms are so tiny that she can't use them when accessing our application "on the cloud". Otherwise, they look fine on a Surface Pro when running it off the cloud. Does anyone have an idea? I do not think there is anything that the people that are hosting our software can do. -paulw On Monday, 29 February 2016 17:30:11 UTC, PW wrote: > Hi, > > I know this is a stretch to ask this question, but: > > We have an Access 2010 application hosted using Remote Desktop. When > we access forms from the desktop they look like they should. And from > an iPad. However, a client is using their Surface Pro the forms are > so tiny that she can't use them when accessing our application "on the > cloud". Otherwise, they look fine on a Surface Pro when running it > off the cloud. > > Does anyone have an idea? I do not think there is anything that the > people that are hosting our software can do. > > -paulw It will cost you, but have a look at a program called "ShrinkerStrether from Peter's Software (http://www.peterssoftware.com/ss.htm) This should shrink or stretch forms and all their controls to match the scr...

from field in form to another form.
What I am looking at doing is I have a couple of forms, when I enter the number of products been despatched on the order form, it then creates a record in the transaction table and also the product history. I have created a couple of update queries which worked well, but did not perform the way that I wanted them to. I wanted to do it using code so that when the despatch order button is pressed it creates the above. The information of the order is in a sub form called Order details on a form called orders., this then wants to create a record in the form transaction history, and another in the product history. I have tried to work on the code but to no avail. sort of looked like this. Forms!transaction history.form![qty required] = forms![order details]. [qty despatched] Were it takes it from the field qty despatched on the order form in the order details sub form and puts it into the form transaction history in the field qty required. I am looking for help on the coding part ie what are the parts made up of i.e. what each part of the code relates to in respect of what it isd doing. Any help much appreciated if you can understand what I am trying to get at. Please Help, A form is just a way of viewing/editing/adding data and doesn't store anything. You can view what you change in one form on any other form, so that if you enter a number in despatched in one form you can view it another form and label it required. You don't want to double enter data. I wo...

Form is link with another form
Macro and button all works fine. It goes to other database and open the form from their. Now only problem is that there are two forms link to each other. When i click on the button it works fine and open that form which i need but there is also a link on that form which open another form. Is it possible that i open the 2nd form which is linked with the first form or any other way Private Sub Command233_Click() On Error GoTo Err_Command233_Click Call Shell("""C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"" ""C:\RDLog.mdb""/XTransOpenForm", 1) Exit_Command233_Click: Exit Sub Err_Command233_Click: MsgBox Err.Description Resume Exit_Command233_Click End Sub * Click Macro (on the left of the screen) * Click New (at the top of the screen) * In the "Action" column scroll down to "OpenForm" * In the options box (lower section of the macro screen) scroll down to the form you want to open. * Just to start with (you can change it later) I would leave the View at "Form" and leave "Fitler" Data" and "Where" all blank. * For the Mode try "Normal" for now. * Save the macro as TransOpenForm Thank You. ...

form access to form excel
Hello, How may I pass in VBA a value from a control in a access 2003 form to a control in a excel 2003 form ? I try this but it does'nt run: (oApp=word.application) oApp.Forms("saisie").tbnom.Value = Form_Form1.tbnom.Value & " " & Form_Form1.tbprenom.Value Thanks. ...

Form to Open Another Form
This is very basic, but here goes, from a form, I want to pass parameters to a query to open another form (form by query?). Using a combo box to select a certain field works ok. But I am having trouble passing those fields which are check boxes. Get "data mismatch". The fields in the underlying table are 'yes/no'. ...

Form/Subform In Continuous Form
Is there a way to put a main form/subform in a continuous form so I can scroll through all the records in the main form? Thanks! "Steve" <Email@Invalid.com> schreef in bericht = news:13sjb1g6t2nsa8a@corp.supernews.com... > Is there a way to put a main form/subform in a continuous form so I = can > scroll through all the records in the main form? >=20 > Thanks! =20 Huh ?? Would that be nice ?? Why do you want that ?? I guess you need to use a continuous form, and open a particular = (filtered) mainform by means of a doubleclick (or something like that) = in the record you need. Arno R Steve wrote: > Is there a way to put a main form/subform in a continuous form so I can > scroll through all the records in the main form? > > Thanks! > You could create a continuous form of the main form (subA). And make a continous form of the subform (subB). Then create/open up a new form (MainForm) and drop both forms into the new form. You wouldn't use Master/Child linking between the two subforms. In the subform SubA you might have in the OnCurrent event some code like Forms!MainForm!SubB.Filter = "CustID = " & Me.CustID Forms!MainForm!SubB.FilterOn = True SuperStar http://www.youtube.com/watch?v=J_3zRh6HeZs Thanks for responding! That's not quite what I want. In your scheme you only see the related records in SubB for the current record in SubA. What I would like to see is something like this: Cu...

MS Access Reading Data from one form to another
I need some help please. I need to show data as disabled but visible on 1 of my forms that is linked up to another table. For example: I have 2 forms and 2 tables. Form A is linked to table A. Form B is linked to Table B. The cost field is from the componentcost table and linked to on Form b, but I want it also to show up on Form A but form A is linked to the inventory table. I only need it to show up on Form A for viewing purposes only, but I don't know how to get that information to show up on Form A. I've tried a subform that doesn't work. I've tried code. This code sorta works but only takes the first number value in the table and its the same value on each record. Its not changing when I scroll from one record to the next in sync with the records on Form B. I hope I"m making sense - any help would be so very much appreciated! Wendy Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.OpenRecordset("SELECT Components.Cost FROM Inventory Right JOIN Components ON Inventory.Component = Components.ID;") txtComponentCost = rs!Cost txtComponentCost.Requery You need to link your Form A to a Query instead of a Table. The query can join Table A and Table B, so you can show the cost field on the inventory form. (david) "Doll" <wshmail2004@yahoo.com> wrote in message news:1145284223.077160.310690@t31g2000cwb.googlegroups.com... >I need some help please. I need to show data as disabled but ...

Navigating from Main form to subform to sub-subform
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to Subtask to Task by pressing a button that makes each subform invisible/visible. The problem exists when I try to navigate from Element to Task to Subtask. Sub-subform Element will become invisible and show Task but when I press the button to go from Task to Subtask it opens the subform but Element is still visible over the Subtask form. Below is the code I am using.... >From Main form, Task to subform, Subtask: Private Sub ViewSubtasks_Click() On Error GoTo Err_ViewSubtasks_Click Me.SubTasks.Visible = True Me.Title.SetFocus Exit_ViewSubtasks_Click: Exit Sub Err_ViewSubtasks_Click: MsgBox Err.Description Resume Exit_ViewSubtasks_Click End Sub Subform Subtask's Title event when title has focus: Private Sub Title_GotFocus() Forms!tasks!SubTasks!Elements.Visible = False End Sub >From sub-subform, Element to Main form, Task: Private Sub ViewTasks_Click() On Error GoTo Err_ViewTasks_Click Forms!tasks!Title.SetFocus Forms!tasks!SubTasks.Visible = False Exit_ViewTasks_Click: Exit Sub Err_ViewTasks_Click: MsgBox Err.Description Resume Exit_ViewTasks_Click End Sub Hi. Hundreds of people ...

Problem with calling subform's button click event from the main form
I am trying to call the click event of a button located in a subform called "Order Subform" from a button in the parent. However, since the subform was made with the wizard, it contains a space in its name, so the syntax that I have found for this has not been working. If anyone knows the syntax for this, I would appreciate it. I believe it is mainform!subform_with_spaces cwm137@psu.edu wrote: > I am trying to call the click event of a button located in a subform > called "Order Subform" from a button in the parent. However, since the > subform was made with...

Link Pop up Form to main form
I have a main form and use a combo box to open a pop up form. The combo box lists customers and only one customer requires the fields that are found on the pop up form. I can get the form to pop up however I do not know how to link the pop up form data to the main form record. On Oct 16, 6:54 am, CJONES <craig...@hotmail.com> wrote: > I have a main form and use a combo box to open a pop up form. The > combo box lists customers and only one customer requires the fields > that are found on the pop up form. > > I can get the form to pop up however I do not know how to link the pop > up form data to the main form record. What else does the combo box do? Does it select a record for editing, the majority of whose fields reside on the main form? If that is the case, then you could set the rowsource of the popup form to the rowsource of the main form. Store the rowsource of the main form to a string variable and pass it in the openargs to the popup form. In the pop-up forms' form_load event, assign it to the popup forms' rowsource. On Oct 16, 11:22 am, OldPro <rrossk...@sbcglobal.net> wrote: > On Oct 16, 6:54 am, CJONES <craig...@hotmail.com> wrote: > > > I have a main form and use a combo box to open a pop up form. The > > combo box lists customers and only one customer requires the fields > > that are found on the pop up form. > > > I can get the form to pop up however I do not know how to link t...

Starting subroutine in a form from another form
Hi, Is it possible to start a subroutine in for example (frmMainForm) from another form (frmSubForm)? I want to start a subroutine called cmdButton1_Click. I wrote (in frmSubForm): frmMainForm.cmdButton1_Click But it didn't work. Thanks, Chris "Chris" <c987web@hotmail.com> wrote in message news:ca5b5$407669de$d5498bb6$30992@news.multikabel.nl... > Hi, > > Is it possible to start a subroutine in for example (frmMainForm) from > another form (frmSubForm)? > I want to start a subroutine called cmdButton1_Click. > > I wrote (in frmSubForm): frmMainForm.cmdButton1_Click > But it didn't work. > > Thanks, > > Chris > > Make sure that in frmMainForm the cmdButton1_Click is not marked as "private" but rather public (Sub cmdButton1_Click()) "Raoul Watson" <WatsonR@IntelligenCIA.com> wrote in message news:<Sctdc.15876$1y1.3638@nwrdny03.gnilink.net>... > "Chris" <c987web@hotmail.com> wrote in message > news:ca5b5$407669de$d5498bb6$30992@news.multikabel.nl... > > Hi, > > > > Is it possible to start a subroutine in for example (frmMainForm) from > > another form (frmSubForm)? > > I want to start a subroutine called cmdButton1_Click. > > > > I wrote (in frmSubForm): frmMainForm.cmdButton1_Click > > But it didn't work. > > > > Thanks, > > > > Chris > > > > >...

Linking Pop up form to Main form
I have a main form with a combo box where if a specific customer is selected a popup form opens and additional information required for this customer is entered into the form. Data from the main form and popup form is stored in the same table. I have a field called certification that I would like to use to link the forms. Greetings, what you need to do is to open the popup form in dialog mode (which is probably already the case). In the popup form you need to add a public property (Get) and assign it the desired value. Note: a form is just a class module except that it has a graphical user interface (GUI - the GUI thing happens way under the hood for Access). In the popup you can create a public property anywhere in the Form's code module (not a standard module or standalone class module). In my sample I am setting a Certification property to a Long datatype. If your Certification is a string, then set the property to String '--code for popup form Public Property Get Certification() As Long Certification = CLng(txtCertification.value) End Property Private Sub cmdOK_Click() Me.Visible = False End Sub In the popup form here I have a textbox called txtCertification. A user enters information here then clicks an OK button (cmdOK) which only hides (Me.Visible = False) the form (don't unload the form - it has to be running so that you can read the value from its property). In the calling form you would call the popup like this: '--code for ma...

Web resources about - repost calling a subform from another form(not main form) - comp.databases.ms-access

London Calling - Wikipedia, the free encyclopedia
London Calling is the third studio album by the English punk rock band The Clash . It was released in the United Kingdom on 14 December 1979 ...

List of country calling codes - Wikipedia, the free encyclopedia
This is a list of country calling codes defined by ITU-T recommendations E.123 and E.164 , also called IDD ( International Direct Dialling ) ...

Free VoIP Calling Added To Facebook Messenger For IOS In The U.K.
Voice-over-Internet-protocol calling has made its way across the pond for Facebook Messenger users, as the social network updated its iOS version ...

Facebook Video Calling - Facebook
Bring your conversations to life on Facebook. With face-to-face video calling, now you can watch your friends smile, wink and LOL. To get started, ...

Orange telecom announces partnership with Facebook to launch social calling app
French telecommunications company Orange today announced a partnership with Facebook to offer a social calling application that will allow users ...

Berlin Calling (@neuraum) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Calling all foodies: Here comes @TwitterFood
There are many thousands of food-related Tweets people send on Twitter each day – Tweets about meals, ingredients, favorites, recipes and dining ...

YUBISASHI NIPPON CALLING ENGLISH for iPhone, iPod touch, and iPad on the iTunes App Store
Get YUBISASHI NIPPON CALLING ENGLISH on the App Store. See screenshots and ratings, and read customer reviews.


Mariah Carey's brother lashes out at singer, calling her an 'evil witch'
In a bizarre outburst, Mariah Carey's older brother has called her an 'evil witch'.

Resources last updated: 3/21/2016 7:58:38 AM