473,394 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Form Parameter for Query

I have a form with two subforms.

The main form holds the Order Number and basic information.

The 1st subform holds an abbreviated list of products in the order and the data source is a table that uses master and child fields to populate.

The 2nd subform holds product details and I am attempting to use a query with one parameter to populate details. On the form load the product detail should be the first product in the 1st subform.

What is the preferred method to populate the query parameter. And will that method work with the initial form load and when an event is fired when a user clicks on a product in the 1st subform.

all assistance appreciated
thanks
daryl
May 5 '06 #1
2 1708
wlc04
70
I'm having a hard time "seeing" your db in my head.

You only mentioned one table - are you using the same table to populate all forms?

Can you give me a little more detail about your table structure then I might be able to help.

:confused:
May 5 '06 #2
cweiss
36
You can set a reference to a form's underlying recordset and return the current value like this:

Expand|Select|Wrap|Line Numbers
  1. Private Function ParamValue() as String
  2.  
  3.     'Assumes your first subform is named Table2_Subform
  4.     Dim rs As DAO.Recordset
  5.     Set rs = Form_Table2_Subform.Recordset
  6.  
  7.     ParamValue = .Fields("ProductID").Value
  8.  
  9. End Sub
Here, ParamValue will always return the value of the ProductID field for the selected record.

You'll probably need to add some error handling for empty recordsets, but otherwise I think you should be able to modify this code to suit what you're trying to do.
May 8 '06 #3

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

Similar topics

9
by: Brendan MAther | last post by:
I have a table called Contact_Info. I have a form that allows me to show all the contacts from a specified city and sector. Once these contacts appear on my new form I would like to be able to...
2
by: rg | last post by:
Hi all, I have query about passing a parameter from form to a query. My situation is as follows: I have a query that pulls up some data from a table, however there is a condition that must...
9
by: David White | last post by:
Hello everyone, I'm new to access, so if this is a dumb question I apologize in advance. I created a query that requires a "parameter value" to be entered. I then created a form to display...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
1
by: jmarr02s | last post by:
When I double click on my form..I get a Parameter Query box. How can I turn this off?! I went to properties, but did not see anything that would help remove this. I also deleted the query...
3
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
3
by: vljones | last post by:
I am either having an extended blond moment or have been looking at this too long. This is a basic question but I simply cannot get my head around the solution. I have a Search form with grouped...
2
by: PotatoChip | last post by:
I am working in Access 2002 and I have been asked to create a form for a report based on a paramter query so that the user selects the department from a drop down list on the form, query runs and...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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
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...

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.