473,505 Members | 13,807 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 6292
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_Form.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.Requery

Dim rst as recordset
Set rst = Forms!1stform.RecordsetClone
rst.FindFirst Forms!1stform.StudentID = Me.StudentID
Forms!1stform.bookmark = 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.Requery

And do you use

On error resume next ?

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


Try only:

rst.FindFirst "[StudentID] = " & str(Me.StudentID)
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.Requery 'requery the Main_Univ form

Dim rst As Recordset

Set rst = Forms!1stform.RecordsetClone

rst.FindFirst "[StudentID] = " & intStudentD

Forms!Main_Univ.Bookmark = rst.Bookmark


The line Forms!1stform.Requery 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.Requery 'requery the Main_Univ form

Dim rst As Recordset

Set rst = Forms!1stform.RecordsetClone

rst.FindFirst "[StudentID] = " & intStudentD

Forms!Main_Univ.Bookmark = rst.Bookmark


The line Forms!1stform.Requery 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...
1
12007
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...
2
2552
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...
6
25646
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...
6
4216
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...
14
3744
by: Simon Abolnar | last post by:
I would like to know how to open child form from dialog form. Thanks for help! Simon
3
1448
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,...
5
5473
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...
7
2674
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...
4
2258
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,...
0
7098
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...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
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...
0
7471
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...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
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...
0
3187
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...
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
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.