473,516 Members | 3,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Navigation - refreshing data from one button to another

5 New Member
I'm just working with a small sample I built before I put this into place in my live database. Here is my problem. I have a Navigation form with two navbuttons (Part1 and Part2). Part1 form has a combo box the looks up a record and displays the results in the text boxes. If I click on the Part2 navbutton and come back to Part1 my original look up has been cleared.

I realize that because the way Navigation forms load and unload the forms this is the nature of the beast. When a user selects the the combo box on Part1 I store that ID number in a tempvars variable.

What I am trying to do is when I go back to Part1, have the tempvars variable set the ID number in the combo box and then refresh / reload / repaint the data. For the life of me I have tried everything. I tried putting code in the OnLoad, OnActivate and several other places with no luck.

Can someone show me how to do this. I figured I could do something like this:

me.comboPart=tempvars("LastPartViewed")
me.comboPart.Requery

When I go back to the Part1 navbutton, the combobox will display the correct item but the rest of the fields have not refreshed and show the first record data from the table.

I know I'm doing something wrong but don't know what.

Thanks
Jul 25 '14 #1
9 1236
twinnyfo
3,653 Recognized Expert Moderator Specialist
I am madly confused....

If Part1 has a record open, what is happening with Part2 that is navigating to another record? A form does not move to a another (or a blank) record magically. You must be telling it to go somewhere....

If it is as simple as when you are on part 1 that updating the combo box will bring up the record you desire, then simply re-execute that code when you assign the correct value to the combo box:

Expand|Select|Wrap|Line Numbers
  1. Me.ComboPart_AfterUpdate
This assumes that you have code assigned to that event.....
Jul 26 '14 #2
sd1961
5 New Member
In my test database I only have the two navigation buttons. Right now Part2 doesn't even have a form to it. My working database does but I'm using this db as a test bed.

The Part1 navigation form has comboPart that looks up a recipie name and then shows data about it. So for example I pull up Chocolate Pie and it displays everything. If I click on Part2 and go back to Part1 (by default) everything is cleared. I have to re-select the Chocolate Pie.

The comboPart_AfterUpdate already has the default code to look up the record so that works when I select a new record but I want it to pull the record back up when I move to Part2 and back to Part1 navigation button. Like I said, Access closes Part1 and opens Part2 when it is clicked and then closes Part2 and opens Part1 when I come back thus the previous on screen record is cleared on Part1

I've tried using the OnLoad event to do it and I can assign the ID I want to the comboPart but when I try requerying it I just get the recipie name and the underlying record doesn't seem to refresh.

Does that make sense? If I could attach a sample I would show you but I don't think this forum has that ability.

Thanks
David
Jul 26 '14 #3
twinnyfo
3,653 Recognized Expert Moderator Specialist
When you runt he code to go back to part1, then do as you have already suggested:

Expand|Select|Wrap|Line Numbers
  1. me.comboPart=tempvars("LastPartViewed")
But then, add my suggestion. This will requery the form to pull up your desired record.
Jul 26 '14 #4
sd1961
5 New Member
Ok I tried that too before and just now to make sure. I get an error "The expression you entered requires the control to be in the active window". This is after being called from the OnLoad event of the Part1 navigation form.

It is almost like it's not loaded. When it breaks at the error you can see the Navigation form is there but the Part1 and Part2 forms are not shown until click OK to acknowledge the error.

I noticed I can attach a file. I'll get a database zipped up in a bit so you can see what I'm talking about. I know Navigation forms are not like subforms but I would still think this is possible OR I'm doing something wrong.
Jul 26 '14 #5
twinnyfo
3,653 Recognized Expert Moderator Specialist
How about opening Part1 from Part2 and applying a filter. This is buildin the DoCmd.Open acForm properties. Very simple to use.
Jul 26 '14 #6
sd1961
5 New Member
Ok I have attached a sample database with 4 little parts. I set the now combo0 to ID 4 when it loads and I commented out the line combo0_AfterUpdate so you won't get the error right off the bat.

So you will see going from Part1 to Part2 the combo box displays part ID 4 correctly but the underlying record is not refreshed.

If you activate the combo0_AfterUpdate line you will get the error I am getting saying the control is not in an active window.

Maybe someone will have the answer.
Attached Files
File Type: zip TestDatabase.zip (49.5 KB, 55 views)
Jul 26 '14 #7
twinnyfo
3,653 Recognized Expert Moderator Specialist
Looking at your DB gave me no clue whatsoever as to what you are trying to do.... Not trying to be a jerk, or anything, I'm just confused. Unless you are publishing this to sharepoint or something like that, there is no need for a Nav Form. Just use a tab control and all your values stay in tact.
Jul 26 '14 #8
sd1961
5 New Member
Thanks. I might have to do that. Just thought this was the way to go for my application but no harm in changing it. Just would like to know if what I'm trying to do is even possible.

Thanks again for all your help.
Jul 26 '14 #9
twinnyfo
3,653 Recognized Expert Moderator Specialist
Because I'm not sure what you are trying to do, I can't give you a reasonable answer.

If what you are trying to do is pull up a record under one tab, then go to another tabl and do something else, then go back to the first tab and continue with what you were doing, then, yes, you can--using a tab control.
Jul 26 '14 #10

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

Similar topics

3
2902
by: Baby Blue | last post by:
I have 2 codes below to grap data from another site. I use them to get the data from one News site. However, when I click on some link inside (such as : http://www.thuthao.info/news/chitiet.php?url=http://vnexpress.net/Vietnam/Kinh-doanh/2005/01/3B9DB0AC/ ), there are some errors, I try fix some, but hopeless. CAN ANY BODY HELP ME ??? MUCH...
19
2372
by: Caesar | last post by:
Hi, I'm wondering if anyone here can point me in the right direction. My host does not provide php, and so I need to pull this data from another server that does support such scripting. Help? JC
2
5071
by: luu duong | last post by:
I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page that is inside a frameset. So firstpage.asp has action="response.htm" target="results". response.htm... <HTML> <FRAMESET ROWS="50%,50%"> <FRAME SRC="header.asp" NAME="fTop"> <FRAME...
5
7065
by: Vanessa | last post by:
I have a question, is that any other way to retrieve data from another webpage besides using XML object? Because I am using XML object now but give me so much problems. If I used MSXML2.ServerXMLHTTP object, it gives me time out error: msxml3.dll error '80072ee2' The operation timed out If I used Microsoft.XMLHTTP object, it will hang...
1
2430
by: David | last post by:
Hi, I have a form which requires Serial Numbers to be loaded from another form. When I press a button, another form opens with a list of Serial Numbers. I have the record selectors enabled. I want to select a serial number range with the record selectors then press a button called 'LOAD'. The selected Serial Numbers should then
4
3429
by: Andrea De Santi | last post by:
How can I redirect to another page with form data? In asp Classic I write: <form ... action="filename">...</form> and in then target page I write <%=request.form("fieldname")%> ..... but in ASP.NET 1.1 'action' does not exist how can I send form data to another page?... and how can I read a form values (same of ASP classic with...
4
2045
by: Peter Afonin | last post by:
Hello, I have a form with several buttons, and I need to post this data to several different applications. In ASP.NET 1.1 it was quite easy - I just used HTML controls (text or hidden), then assigned the action to each button on Page_Load event: Me.ibPayWM.Attributes.Add("onclick",...
9
2341
by: sandykumar | last post by:
hiii i want to transfer data from one site to another site. there is a form in site www.abc.com and this form is similer to form of site www.xyz.com. data filled in form of site www.abc.com is transer to form of www.xyz.com and data should be submitted and result will be displayed in www.abc.com
7
2563
by: Boki | last post by:
Hi All, I can't pass data to another form: in form2: private void button1_Click(object sender, EventArgs e) { Form1 form_copy = new Form1();
2
2062
by: thread | last post by:
Hi All i'm building a database in access and i want to restrict permissions. from the access i can just limit the posiblity to unhide an hidden table and in this way i can preventing the users from looking in un- relevant data my problem is how can i prevent the posiblity to import the data from another mdb file becaouse it is quite simple...
0
7273
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
7182
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
7574
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
7136
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
7547
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...
0
5712
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3252
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1620
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 we have to send another system
1
823
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.