473,698 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need held with a subform

84 New Member
I have an unbound form (A). The form contains lists boxes that get information from different tables. When the form is opened the lists are populated with various bits of data. The operator will select certain items from the list boxes.

I have a query (Z) that uses the information the operator selects on form (A). This information is listed in the criteria section of the query.

I have a form (B) that is bound to query (Z).

On form (A) I have a command button that will open form (B). This works great.
All data from query Z is displayed.

I created a subform (C) on form (A) that should display the results that appear in form (B). I am not sure how to change the command button code to make this happen. Does anyone have any idea's? I have listed the command code I am currently using.


Private Sub Command34_Click ()
On Error GoTo Err_Command34_C lick

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "B"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command34_ Click:
Exit Sub

Err_Command34_C lick:
MsgBox Err.DESCRIPTION
Resume Exit_Command34_ Click

End Sub
May 3 '07 #1
12 1682
Rabbit
12,516 Recognized Expert Moderator MVP
You'll want the button to requery the subform.
May 3 '07 #2
sesling
84 New Member
You'll want the button to requery the subform.
ok. would I keep the existing code in the onclick command or would that need to change? if so, how?
May 3 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
You'll need to change it because I'm assuming you want to go with a subform instead of using a second form. So obviously you'll want to get rid of that line.

A requery is usually done using the Requery method of the control.
May 3 '07 #4
sesling
84 New Member
You'll need to change it because I'm assuming you want to go with a subform instead of using a second form. So obviously you'll want to get rid of that line.

A requery is usually done using the Requery method of the control.

Sorry but I am not following what needs to be done. How would I change the current command control (see original post) to run the requery? How would I reference the subform in the requery command? Don't I still need to call the original form or query to get the data to display?
May 3 '07 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Sorry but I am not following what needs to be done. How would I change the current command control (see original post) to run the requery? How would I reference the subform in the requery command? Don't I still need to call the original form or query to get the data to display?
The requery is simply Me.subformcontr ol.Requery. I'm not sure what you mean by calling the original form or query to get the data to display.
May 3 '07 #6
sesling
84 New Member
The requery is simply Me.subformcontr ol.Requery. I'm not sure what you mean by calling the original form or query to get the data to display.
My new command button (on-click) code is listed below. FILETYPE is the name of the subform. When I click on the command button I do not see the results of the query. If I go into edit mode on the form and then back to view the results are populated on the form. Am I missing another step?

Private Sub Command34_Click ()
On Error GoTo Err_Command34_C lick

Me.FILETYPE.Req uery

Exit_Command34_ Click:
Exit Sub

Err_Command34_C lick:
MsgBox Err.DESCRIPTION
Resume Exit_Command34_ Click

End Sub
May 3 '07 #7
Rabbit
12,516 Recognized Expert Moderator MVP
Try Me.Filetype.For m.Requery
May 4 '07 #8
sesling
84 New Member
Try Me.Filetype.For m.Requery
Tried that and got the same result. Are there any other things I can try?
May 4 '07 #9
sesling
84 New Member
Try Me.Filetype.For m.Requery
I think I found what I was doing wrong. See my code below. This seems to work.

Private Sub Command34_Click ()
On Error GoTo Err_Command34_C lick

Me.FILETYPE.sou rceObject = "queryZ"

Exit_Command34_ Click:
Exit Sub

Err_Command34_C lick:
MsgBox Err.DESCRIPTION
Resume Exit_Command34_ Click

Me.Filetype.For m.Requery

End Sub

However this leads to my next issue. On the subform are file records that contain ID's. When I use the original form that the subform is based on I can double click on the file and the ID is passed to another query and those results appear on the screen. Again my query criteria has forms!formB!FIL EID. Now that the information is being displayed in the subform how can I get the double click option to work? When I look at the properties for the subform there are no options for onClick or onDblClick. When I double click on the item i get a screen pop up that requests to value for forms!formB!FIL EID. I tried changing the query criteria to forms!FILETYPE! .ID but that did not work. I know how to pass a value from a form to a query but is it even possible to pass a value from a subform to a query? If so, how?
May 4 '07 #10

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

Similar topics

4
1900
by: Jeremiah J. Burton | last post by:
I am trying to create a database (in Acces 2000) to track my fossil collection. I have a main table that has records for every specemen. I have a secondary table with information on localities that the specimens were collected at. The tables are linked. Each record in the specimen table will link to only 1 record in the locality table, however each locality can be linked to multiple specimens. I am trying to create a form (based on...
2
1390
by: Ellen Manning | last post by:
Using A2K. I've got a form with 2 subforms (a subform within a subform). When the user enters an amount on the main form, I place that amount in subform1 with no problem but can't seem to get it placed in subform2 correctly. It remains zero. Below explains it better hopefully: Amount: $25 <user enters amount and it gets placed in subform1 amount> <Subform 1> Fund #: <blank until user enters> Amount: $25
9
2335
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There is a Judge Table (information about judges) judgeID = autonumber key
2
2125
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a relative newcomer to Access and need to be methodical until it become more familiar. Thanks in advance for your help. I have a form with a subform that has a subform. form: frmEvents subform: sfrmTrialInfo (controlname = )
1
1385
by: Eric | last post by:
There are two sub forms in main form. One has values: Outlet Equipment 2 ABCBCBD 3 DKJDKJD 4 KDJKDJK Second has also a variable name outlet. I need help how to i display the equipment next to the outlet in 2nd subform from first subform. I dont want to save this into table just need a display in the second
1
2890
by: shenanwei | last post by:
I have db2 v8.2.5 on AIX V5.3 with all the switches on Buffer pool (DFT_MON_BUFPOOL) = ON Lock (DFT_MON_LOCK) = ON Sort (DFT_MON_SORT) = ON Statement (DFT_MON_STMT) = ON Table (DFT_MON_TABLE) = ON Timestamp (DFT_MON_TIMESTAMP) = ON Unit of work ...
3
3968
by: suek | last post by:
I have a table with over 4000 records to search upon, and the users don't like a combo box. So what I have been trying to do for the last twelve hours is do some code to get a text box to search. I am learning fast, but I really don't know how to do it, and would appreciate some help. So far I have got to this: Private Sub btnSearch_Click() Dim strFindLocation As String
5
1611
by: blakerrr | last post by:
Hi everyone, I have a form called Master Order with a subform in it called Order Info. The subform has a nested subform in it called Order Details. Master Order cycles through all of the parts in my database. Order Info contains order specific information (order number, employee ordering, date of order, etc. ) and Order Details contains all of the parts in the order (run off a junction table linking it with Order Info via the orderID...
1
1564
by: Dave | last post by:
Hello, I know that I can use the Parent property to get the name of the form that a subform is on, but what if I need the name of the subform/ subreport "box" on that form that contains my subform? I've not found a direct way to get that little nugget of information. Thanks for your time, David
0
8674
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9023
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7721
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
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
2
2327
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.