473,569 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manipulating other open form from a form

52 New Member
I would like to manipulate other form from a form. For example, I want to requery the recordset of one form while working on another form. Is there a way?
Sep 10 '06 #1
9 6296
PEB
1,418 Recognized Expert Top Contributor
I would like to manipulate other form from a form. For example, I want to requery the recordset of one form while working on another form. Is there a way?
MMMm Yes...

Forms!Other_For m.Requery

Hope helps...

:)
Sep 10 '06 #2
gazelle04
52 New Member
I've tried that but it won't work.

The first form was my main form and the second form is the data entry form. When I click a button on the first form to open that second form(data entry) and I close that second form the first form should be requerried to have the new data. The first form is still open while I'm working on the second form.

The first form should have already the data I've entered on the second form using requery while the're both open.
Sep 11 '06 #3
gazelle04
52 New Member
It works !!!

Sorry about that. I must have some codes that is mixed with the procedure that stops it from working.

Thanks again Peb
Sep 11 '06 #4
gazelle04
52 New Member
As a follow up to that. After I closed the 2nd form I wanted to show the data I've entered on the 2nd form to be reflected on the first form right away after I close the second form. Can I use the FindFirst method to refresh the first form. Can I use this codes on the 2nd form.

DoCmd.Close
Forms!1stform.R equery

Dim rst as recordset
Set rst = Forms!1stform.R ecordsetClone
rst.FindFirst Forms!1stform.S tudentID = Me.StudentID
Forms!1stform.b ookmark = rst.bookmark


I did that but the 2nd form never closes and it never requeried the 1st form.

Is there any other way?
Sep 12 '06 #5
PEB
1,418 Recognized Expert Top Contributor
Hi,

DoCmd.Close

refers to the active form in the moment! So the active form is closed or the active query and what is open and active... I think that with the close method you can specify the thing you want to close!

Forms!1stform.R equery

And do you use

On error resume next ?

And about this line:
rst.FindFirst Forms!1stform.S tudentID = Me.StudentID


Try only:

rst.FindFirst "[StudentID] = " & str(Me.StudentI D)
Sep 12 '06 #6
PEB
1,418 Recognized Expert Top Contributor
If you want to close the second form, so it's better that you run all the code and after it close the form!

Closing maybe canceled if there is a form code that is running!
Sep 12 '06 #7
gazelle04
52 New Member
I can't make it work. Here are my codes again:

This is on the Close button of the 2nd form (the 1st form is still open.)

intStudentD = Me.StudentID ' this is a global variable

DoCmd.Close 'closes this 2nd form

Forms!1stform.R equery 'requery the Main_Univ form

Dim rst As Recordset

Set rst = Forms!1stform.R ecordsetClone

rst.FindFirst "[StudentID] = " & intStudentD

Forms!Main_Univ .Bookmark = rst.Bookmark


The line Forms!1stform.R equery runs because the total records on the first form is updated when I close the 2nd form. I cant make it, please help.
Sep 12 '06 #8
PEB
1,418 Recognized Expert Top Contributor
I can't make it work. Here are my codes again:

This is on the Close button of the 2nd form (the 1st form is still open.)

intStudentD = Me.StudentID ' this is a global variable

DoCmd.Close 'closes this 2nd form

Forms!1stform.R equery 'requery the Main_Univ form

Dim rst As Recordset

Set rst = Forms!1stform.R ecordsetClone

rst.FindFirst "[StudentID] = " & intStudentD

Forms!Main_Univ .Bookmark = rst.Bookmark


The line Forms!1stform.R equery runs because the total records on the first form is updated when I close the 2nd form. I cant make it, please help.

Hi,

try this:
Expand|Select|Wrap|Line Numbers
  1.         intStudentD = Me.StudentID      ' this is a global variable
  2.  
  3.         Forms!1stform.Requery 'requery the Main_Univ form
  4.  
  5.         Dim rst As Recordset
  6.  
  7.         Set rst = Forms!1stform.RecordsetClone
  8.  
  9.         rst.FindFirst "[StudentID] = " & Str(intStudentD)
  10.  
  11.         Forms!Main_Univ.Bookmark = rst.Bookmark
  12.  
  13.         DoCmd.Close      'closes this 2nd form
  14.  
  15.  
And please verify which line isn't executed! So it will be easier to check it!

:)
Sep 12 '06 #9
gazelle04
52 New Member
I found the culprit. Actually my codes are working alright. You know what is the culprit. Its the latebinding of some subforms. It can't refresh the current record of the 1st form from the 2nd form while other subforms on the 1stform are unbounded (their sourceobject property being empty)

My main form (which is the 1st form) consist of a tab control with subforms in it. I use the late binding of sourceobject property of the subforms to make the loading of the main form faster. That is the reason why its not updating the current record on the 1stform although the total number of records as shown on the status bar at bottom of the screen is updated.

I place the binding procedure on a command button for opening the 2nd form and while I'm working on the 2nd form the subforms was reconnected (their sourceobject property was being filled) at the background. And when I closed the 2nd form alas! the main form was updated on whatever I entered on the 2nd form.

Anyway thanks again for all your support in analyzing my codes.
Sep 12 '06 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
462
by: Konstantin | last post by:
Can someone help me figure out a way to open a form only once in an MDI app. I have an MDI app that contains several forms. I use each form depending on the type of document that the user needs to see, i.e. for documents of type A, I use form A, for type B, form B, etc. Each document has a unique number. I need the app to only show one...
1
12023
by: edself | last post by:
I have a form which displays a subform datasheet of information. I'd like to be able to quickly click on a particular record and open up another form showing more detailed information about that record from a related table. Is there a way to do this? It would be nice to be able to right click on a cell in a datasheet and then select menu...
2
2555
by: XxLicherxX | last post by:
Hi, Can someone tell me how I can open a form to a specific record from a button on another form. Here is what I want to have happen. I have one form called Computers and another form called Monitors. One of the fields on the Computers form is called Monitor. There is a button on the Computers form that will open up the Monitors form.
6
25668
by: lauren quantrell | last post by:
I have a command button on a continuous subform and I want the user to click it to open a small popup form that opens in the position of the mouse (which is the same as the position of the command button on each record of the continuous subform.) I'm hoping someone can tell me how to do this. Thanks, lq
6
4221
by: Bernardo | last post by:
Hi, I Want to open a form that a user specify in a textbox... Thereis any way to open a form having justt only is name? Ex: txtForm.Text = "frmSomething" Form oform= new (Form)txtForm.Text.ToString(); oform.open();
14
3752
by: Simon Abolnar | last post by:
I would like to know how to open child form from dialog form. Thanks for help! Simon
3
1452
by: Rudemusik | last post by:
Hello all! Working in vb.net, with VS 2003. I have 2 projects in a solution. Pretty much a client server setup. Project A controls when a message box open up on Project B. Click a button on A, and the message box will open on B. and the message box in this case is a small form. Pretty much all the control I have is the forms. Depending...
5
5476
by: BD | last post by:
I am coding with C# in Visual Studio 2005 for a database application residing on remote MS SQL Server 2005. What I want to do is open the same form but from 2 different places and only one instance. I currently have the form where it will open from a double click on datagridview from another form to the proper record and only one instance. ...
7
2680
kcdoell
by: kcdoell | last post by:
Hello: I have a form that I want to open using a filter that I have created. I have done this usually by pointing the record source of the form to the query/filter that I created. In this new project, I want to open the form using the "On Open" event, via the properties of the form, and leave my record source pointing to the original table...
4
2259
by: Martin Bentler | last post by:
I have a form that is locked for editing, adding or deleting. Through the use of a command button I open another form, that allows editing, plus allows the user to other areas of the database, through command buttons. When I click the command button I want to open the second form displaying the CompanyName and information from the first form...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.