473,378 Members | 1,449 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,378 software developers and data experts.

Urgent! Subform populating another form

I have a form with a sub-form (in continuous forms view to simulate a
datasheet view)
from which the user can double-click a product number and open a new
form which will display that number and lookup all its details (about
30 fields) which will display also.
I first tried this code on the textbox of the subform (using the on
doubleclick event):
[Forms]![ProductDetailForm]![ProductNumber] = [Forms]![MainForm]!
[SearchSubform]! _[ProductNumber] to populate the textbox only for the
detail form, which it did sucessfully, but I can't get the DetailForm
to get the other 29 fields to populate. I tried something like this
unsuccessfully on the AfterUpdate event for the successfully populated
ProductNumber textbox, but nothing else populated:

Private Sub ProductNumber_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.ProductNumber) Then
If Me.Dirty Then
Me.Dirty = False
End If
Set rs = Me.RecordsetClone
rs.FindFirst "[ProductNumber] = " & Me.AssetNumber
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub

I tried writing a query on the load event of the detail form:

Private Sub Form_Load()
DoCmd.OpenQuery "ProductDetailQuery"
End Sub

Here's the query:

SELECT Products.[ProductNumber]..................etc.
FROM Products
WHERE (((Products.[ProductNumber])=[Forms]![MainForm]![SearchSubform]!
[Product Number]));

This failed to work also.... any help would be appreciated!! Thanks!

Mar 20 '07 #1
1 1435
On 19 Mar 2007 20:10:49 -0700, ca***************@yahoo.com wrote:

Create a form and bind it to the Product table. Make sure you can
scroll through the products just fine.
Invoke that form from the double-click event as follows:
DoCmd.OpenForm "MyProductForm", , , "ProductID=" & Me.ProductID

This assumes your Product table has a ProductID field (primary key).

-Tom.

>I have a form with a sub-form (in continuous forms view to simulate a
datasheet view)
from which the user can double-click a product number and open a new
form which will display that number and lookup all its details (about
30 fields) which will display also.
I first tried this code on the textbox of the subform (using the on
doubleclick event):
[Forms]![ProductDetailForm]![ProductNumber] = [Forms]![MainForm]!
[SearchSubform]! _[ProductNumber] to populate the textbox only for the
detail form, which it did sucessfully, but I can't get the DetailForm
to get the other 29 fields to populate. I tried something like this
unsuccessfully on the AfterUpdate event for the successfully populated
ProductNumber textbox, but nothing else populated:

Private Sub ProductNumber_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.ProductNumber) Then
If Me.Dirty Then
Me.Dirty = False
End If
Set rs = Me.RecordsetClone
rs.FindFirst "[ProductNumber] = " & Me.AssetNumber
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub

I tried writing a query on the load event of the detail form:

Private Sub Form_Load()
DoCmd.OpenQuery "ProductDetailQuery"
End Sub

Here's the query:

SELECT Products.[ProductNumber]..................etc.
FROM Products
WHERE (((Products.[ProductNumber])=[Forms]![MainForm]![SearchSubform]!
[Product Number]));

This failed to work also.... any help would be appreciated!! Thanks!
Mar 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.