473,715 Members | 6,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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]![ProductDetailFo rm]![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_A fterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.Produ ctNumber) Then
If Me.Dirty Then
Me.Dirty = False
End If
Set rs = Me.RecordsetClo ne
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 "ProductDetailQ uery"
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 1455
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]![ProductDetailFo rm]![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
unsuccessful ly on the AfterUpdate event for the successfully populated
ProductNumbe r textbox, but nothing else populated:

Private Sub ProductNumber_A fterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.Produ ctNumber) Then
If Me.Dirty Then
Me.Dirty = False
End If
Set rs = Me.RecordsetClo ne
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 "ProductDetailQ uery"
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
2437
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 actually the name of a form element on the parent window. On the new page, I have this javascript: ---- var var2 = location.search.substring(9); document.write(var2)
9
4312
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 data format is european DD.MM.YYYY (for days) and 01.MM.YYYY (for months). The input format is not recognizable as a DATE input to a DB2 LOAD for
8
5258
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 developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
28
3056
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
2955
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: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
7
7249
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" id="d_links"> multiple <a href="hello.aspx?q=something">something</a><a href="hello.aspx?q=something1">something1</a><a
8
2772
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 partially in c and partially in fortran. I guess i need to change host specific files to make it working. I wonder if standard header files are going to change in this case.my current windows compiler doesn't have sys/resource.h but unix compiler...
1
1923
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 socket. some time error is---"An existing connection was forcibly closed by the remote host" and some time error is--- "A connection attempt failed because the connected party did not properly respond after a period of time, or established...
3
6469
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 the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
7
5983
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 it? If not, how do I have to change my deployment strategy? Thanks!
0
8823
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
9343
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9198
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
9047
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6646
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
4477
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.